|
-
Jun 13th, 2000, 09:57 AM
#1
Thread Starter
Addicted Member
I have a textbox and a command button,i want to be able to clear the text box message when i click the command button ..and then have another message appear when the previous message disappears..i want to accomplish this by using just one textbox and just one command button...
Thanks :0)
-
Jun 13th, 2000, 10:11 AM
#2
Hyperactive Member
-
Jun 13th, 2000, 10:13 AM
#3
Put this code in your command button.
Text1.Text = ""
Text1.Text = "This is the new text"
-
Jun 13th, 2000, 12:40 PM
#4
Thread Starter
Addicted Member
Thanks for the reply..
Thanks for replying too you both..but i can accomplish it with two text boxes..
but i want to do it with just one textbox and one command button
Martinliss: I Tried that code already,but when ever i use it , the event procedure for the button just prints the last text that was entered
Here's how i sort of accomplish this ..
Private Sub Form_Load()
Text1.Text = "My First message"
End Sub
Private Sub Command_Click()
Text1.Text = ""
Text1.Text = "My Second Message"
Text1.Text = "My Third Message" <-------The Program Just ignores The Second
Text1.Text and inputs the third one!
I know it is possible to do what i want becuase i have a keygenerator that was made with visual basic and it changes the text in the text box with only one button.
But in any case, thanks
:0)
-
Jun 13th, 2000, 07:29 PM
#5
Sophtware,
Try this code in the command button:
Code:
Static ncount As Integer
Select Case ncount
Case 0
Text1.Text = "Message2"
Case 1
Text1.Text = "Message3"
End Select
ncount = ncount + 1
Hope this helps
-
Jun 13th, 2000, 07:37 PM
#6
Hyperactive Member
I Can Help
Basically you want a pause, function.... However Visual Basic Doesn't have one, but it can be easily created.
Create a Module, and place this code in it.
Sub Pause (duratn As Integer)
Let curent = timer
Do Until Timer - curent >= duratn
DoEvents
Loop
End Sub
Now you can pause for a certain amount of seconds when ever you want.
Example: Pause(1)
would pause for 1 second.... Now just place this between, text2.text and text3.text...
Hope that helps
-RaY
VB .Net 2010 (Ultimate)
-
Jun 13th, 2000, 07:39 PM
#7
Hyperactive Member
PS
Try to make Module for this command by itself, if not possible make sure there is no Option Explicit in the module or this would not work....
PSS
Text1.Text = ""
Text1.Text = "My Second Message"
Pause(2)
Text1.Text = "My Third Message" <-------The Program Just ignores The Second
Text1.Text and inputs the third one!
-RaY
VB .Net 2010 (Ultimate)
-
Jun 13th, 2000, 08:55 PM
#8
fallnwrld: Your right, VB doesn't have a Pause function, but it does have a Wait API.
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
So Wait(2000) will pause the code for 2 seconds.
-
Jun 13th, 2000, 09:11 PM
#9
Hyperactive Member
Hehhe
Im a dinosaur...still using vb3, so had to create my own....sucks doesnt it
-RaY
VB .Net 2010 (Ultimate)
-
Jun 13th, 2000, 10:48 PM
#10
Thread Starter
Addicted Member
Thanks!
Thanks for all of your help...i dont know how to use modules yet so i am going to have to read that section in my textbook.
Thanks :0)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|