Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 17974
Number of posts: 55343

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
place a <enter> in a textbox Posted by robokop on 30 Dec 2004 at 6:23 AM
I made a code in VB 6.0 to generate a string with some random values
i have a text1 textbox element and a key Command1
this is the script of what happens after the click on the button

Private Sub Command1_Click()
Dim lijst(1 To 128) As Integer
Dim lopendevar As Integer
Dim pendevar As Integer
Dim opendevar As Integer
Dim random As Integer
Dim check As Boolean
Text1.Text = ""
For opendevar = 1 To 15
Randomize
random = Round(Rnd * 256 + 1)
For lopendevar = 1 To 128
lijst(lopendevar) = random
Randomize
random = Round(Rnd * 256 + 1)
check = True
Do Until check = False
check = False
For pendevar = 1 To lopendevar
If random = lijst(lopendevar) Then
check = True
End If
Next
If check = True Then
Randomize
random = Round(Rnd * 256 + 1)
End If
Loop
Next
For lopendevar = 1 To 128
Text1.Text = Text1.Text & "codealgorithmmatrix[" & opendevar & "," & lopendevar & "] := " & lijst(lopendevar) & "; "
Next
Next
End Sub

and after every ";" i want to place an <enter>
Report
Re: place a <enter> in a textbox Posted by iwilld0it on 30 Dec 2004 at 7:36 AM
This message was edited by iwilld0it at 2004-12-30 7:37:14

: I made a code in VB 6.0 to generate a string with some random values
: i have a text1 textbox element and a key Command1
: this is the script of what happens after the click on the button
:
: Private Sub Command1_Click()
: Dim lijst(1 To 128) As Integer
: Dim lopendevar As Integer
: Dim pendevar As Integer
: Dim opendevar As Integer
: Dim random As Integer
: Dim check As Boolean
: Text1.Text = ""
: For opendevar = 1 To 15
: Randomize
: random = Round(Rnd * 256 + 1)
: For lopendevar = 1 To 128
: lijst(lopendevar) = random
: Randomize
: random = Round(Rnd * 256 + 1)
: check = True
: Do Until check = False
: check = False
: For pendevar = 1 To lopendevar
: If random = lijst(lopendevar) Then
: check = True
: End If
: Next
: If check = True Then
: Randomize
: random = Round(Rnd * 256 + 1)
: End If
: Loop
: Next
: For lopendevar = 1 To 128
: Text1.Text = Text1.Text & "codealgorithmmatrix[" & opendevar & "," & lopendevar & "] := " & lijst(lopendevar) & "; "
: Next
: Next
: End Sub
:
: and after every ";" i want to place an <enter>
:

vbCrLf (<enter>)

strValue & vbCrLf



Report
Re: place a <enter> in a textbox Posted by robokop on 30 Dec 2004 at 11:35 AM
: This message was edited by iwilld0it at 2004-12-30 7:37:14

: : I made a code in VB 6.0 to generate a string with some random values
: : i have a text1 textbox element and a key Command1
: : this is the script of what happens after the click on the button
: :
: :
Private Sub Command1_Click()
: : Dim lijst(1 To 128) As Integer
: : Dim lopendevar As Integer
: : Dim pendevar As Integer
: : Dim opendevar As Integer
: : Dim random As Integer
: : Dim check As Boolean
: : Text1.Text = ""
: : For opendevar = 1 To 15
: : Randomize
: : random = Round(Rnd * 256 + 1)
: : For lopendevar = 1 To 128
: :     lijst(lopendevar) = random
: :     Randomize
: :     random = Round(Rnd * 256 + 1)
: :     check = True
: :     Do Until check = False
: :         check = False
: :         For pendevar = 1 To lopendevar
: :             If random = lijst(lopendevar) Then
: :                check = True
: :             End If
: :         Next
: :         If check = True Then
: :             Randomize
: :             random = Round(Rnd * 256 + 1)
: :         End If
: :     Loop
: : Next
: : For lopendevar = 1 To 128
: : Text1.Text = Text1.Text & "codealgorithmmatrix[" & opendevar & "," & lopendevar & "] := " & lijst(lopendevar) & "; "
: : Next
: : Next
: : End Sub

: :
: : and after every ";" i want to place an <enter>
: :
:
: vbCrLf (<enter>)
:
:
: strValue & vbCrLf
: 

:
:
:
thank you



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.