| |
|
Welcome to KnowledgeSutra - Dear Guest | |
Visual Basic 6.0 Help Needed
Started by rejected, Dec 04 2005 08:26 AM
21 replies to this topic
#2
Posted 04 December 2005 - 06:11 PM
Don't really understand what you are trying to do... Do you mean having a textbox that says:
"Hello My Name Is "
and then adding
"Rejected" to it?
Or do you mean
Rejected
Then adding "Hello My Name is.." above that?
Either way try just doing...
[code]
txtBox.text="Rejected"
txtBox.text="Hello my name is" & txtBox.text
Feel free to pm me if I didnt understand...Also sorry i havnt used VB in a while, I may be wrong
"Hello My Name Is "
and then adding
"Rejected" to it?
Or do you mean
Rejected
Then adding "Hello My Name is.." above that?
Either way try just doing...
txtBox.text="Hello my name is..." txtBox.text=txtBox.text & "Rejected"OR
[code]
txtBox.text="Rejected"
txtBox.text="Hello my name is" & txtBox.text
Feel free to pm me if I didnt understand...Also sorry i havnt used VB in a while, I may be wrong
#3
Posted 04 December 2005 - 06:26 PM
Hi
That code works,but it doesn't add new lines,it just appends text at the end of existing one.To add a new line,you would type something like this.
It is neccesary to use vbCrLf (Chr$(13) & Chr$(10)) because using only vbCr(Chr$(13)) or vbLf(Chr$(10)) will display single caracter,and won't insert new line.Hop this helped a bit.
Cheers
That code works,but it doesn't add new lines,it just appends text at the end of existing one.To add a new line,you would type something like this.
Text1.Text = "This is line one in the textbox" Text1.Text = Text1.Text & vbCrLf & "This is line two in the textbox"
It is neccesary to use vbCrLf (Chr$(13) & Chr$(10)) because using only vbCr(Chr$(13)) or vbLf(Chr$(10)) will display single caracter,and won't insert new line.Hop this helped a bit.
Cheers
#4
Posted 21 December 2007 - 07:46 PM
Appends%20vs%20add%20item
Visual Basic 6.0 Help Needed
Well, I'm trying to load many random numbers one under another in a textbox, but when those items are about 30000 this process gets really slow. I'm using the same code:
Textbox = textbox & line & vbCrLf
But when the textbox is really big, then it became slow and slow. Is there any other way to add text at the end of the textbox multiline? Thanks.
-hotpadrino
Visual Basic 6.0 Help Needed
Well, I'm trying to load many random numbers one under another in a textbox, but when those items are about 30000 this process gets really slow. I'm using the same code:
Textbox = textbox & line & vbCrLf
But when the textbox is really big, then it became slow and slow. Is there any other way to add text at the end of the textbox multiline? Thanks.
-hotpadrino
#5
Posted 04 January 2008 - 10:00 AM
FeedBacker, on Dec 21 2007, 08:46 PM, said:
Appends%20vs%20add%20item
Visual Basic 6.0 Help Needed
Well, I'm trying to load many random numbers one under another in a textbox, but when those items are about 30000 this process gets really slow. I'm using the same code:
Textbox = textbox & line & vbCrLf
But when the textbox is really big, then it became slow and slow. Is there any other way to add text at the end of the textbox multiline? Thanks.
-hotpadrino
Visual Basic 6.0 Help Needed
Well, I'm trying to load many random numbers one under another in a textbox, but when those items are about 30000 this process gets really slow. I'm using the same code:
Textbox = textbox & line & vbCrLf
But when the textbox is really big, then it became slow and slow. Is there any other way to add text at the end of the textbox multiline? Thanks.
-hotpadrino
I can see that i can be slow, it's a lot of information... Do you need a user to see these numbers as they appear? If not, you can just fill the numbers to a variable, and then just display that variables' contents...
What makes this process slow, is that VB engine, refreshes the data every time you update your text box information... So, every time you add a new line, VB refreshes the entire Text property...
One way to solve this would be:
Dim i As Long Dim s As String For i = 1 to 50000 s= s & Trim(Cstr(i)) & vbCrLf Next i Text1.Text = s
This will add 50000 lines to variable s, and then assign s to text box Text1... Doing it this way, is much quicked, because VB doesnt have to refresh the text box 50000 times, only once...
Hope this helped...
#6
Posted 09 January 2008 - 02:41 PM
adding text in VB
Visual Basic 6.0 Help Needed
I am trying to create my own little word processor. My first goal is to add a character every time you press a button. I seem unable to add characters to the text box. My button click just replaces the text in the box with a single letter over and over. I just don't seem to know the code or property to do this. Help!
Text1.Text = "a"
(the code to have an "a" show up...My goal is to hit a button and have the same number of "a's" (in this case) show up. How to do?
Visual Basic 6.0 Help Needed
I am trying to create my own little word processor. My first goal is to add a character every time you press a button. I seem unable to add characters to the text box. My button click just replaces the text in the box with a single letter over and over. I just don't seem to know the code or property to do this. Help!
Text1.Text = "a"
(the code to have an "a" show up...My goal is to hit a button and have the same number of "a's" (in this case) show up. How to do?
#7
Posted 20 January 2008 - 06:22 AM
speed of vb6
Visual Basic 6.0 Help Needed
Replying to Galahad
I'm curious about the speed of vb6. Applications I have written are very slow, when it comes to calculating numbers, etc. Coordinates, prime numbers and so on. I made some kind of brute force prime number calculator and it is extremely slow. Similar kind of setup made with see++ works way much faster, so is there something wrong in vb6 or in my code?
Visual Basic 6.0 Help Needed
Replying to Galahad
I'm curious about the speed of vb6. Applications I have written are very slow, when it comes to calculating numbers, etc. Coordinates, prime numbers and so on. I made some kind of brute force prime number calculator and it is extremely slow. Similar kind of setup made with see++ works way much faster, so is there something wrong in vb6 or in my code?
#8
Posted 12 February 2008 - 10:08 AM
FeedBacker, on Jan 20 2008, 07:22 AM, said:
speed of vb6
Visual Basic 6.0 Help Needed
<a href=http://www.trap17.com/forums/index.php?showtopic=30880&view=findpost&p=366104>Replying to Galahad</a>
I'm curious about the speed of vb6. Applications I have written are very slow, when it comes to calculating numbers, etc. Coordinates, prime numbers and so on. I made some kind of brute force prime number calculator and it is extremely slow. Similar kind of setup made with see++ works way much faster, so is there something wrong in vb6 or in my code?
Visual Basic 6.0 Help Needed
<a href=http://www.trap17.com/forums/index.php?showtopic=30880&view=findpost&p=366104>Replying to Galahad</a>
I'm curious about the speed of vb6. Applications I have written are very slow, when it comes to calculating numbers, etc. Coordinates, prime numbers and so on. I made some kind of brute force prime number calculator and it is extremely slow. Similar kind of setup made with see++ works way much faster, so is there something wrong in vb6 or in my code?
Well, VB by design is kind of slow for some operations... I see that it would be slow on prime number calculations... Visual Basic is interpreted not compiled code, and from that comes its slowness... What youc oudl do, is create a project, and under Project options window, use optimisations like, "Optimize for fast code", enable "Favour pentium pro", and alike...
Also, try how different variable types affect the speed, integer, long, single, double...
Also, compiled code will run much faster than from IDE, always remember that...
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














