|
-
September 26th, 2001, 02:10 PM
#1
Basic MsgBox question.
I'm studying the basics of VB6 programming, but the manual doesn't give a clear example of how to make a message box pop up ON FOCUS.
I have 2 text boxes, number1 and number2, which equal textbox numbersum. If numbersum = 0.5 or greater, I want a message box to pop up when that text box becomes focused.
Please tell me how to do this.
Many thanks.
Dave
-
September 26th, 2001, 02:49 PM
#2
Re: Basic MsgBox question.
Open a new project, place on three textboxes and add this code, as soon as textbox3 three gets focus, the code will run...
option Explicit
private Sub Text3_GotFocus()
If IsNumeric(Text1.Text) And IsNumeric(Text2.Text) then
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End If
If Val(Text3.Text) > 0.5 then
MsgBox "It's about .5", vbOKOnly
End If
End Sub
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
|