Friday, May 15, 2009

The procedure for the OK button

The procedure for the OK button

Private Sub OK_Click()
Dim userMsg As String
userMsg = InputBox("What is your message?", "Message Entry Form", "Enter your messge here", 500, 700)

If userMsg <> "" Then
message.Caption = userMsg
Else
message.Caption = "No Message" End If
End Sub

When a user click the OK button, the input box as shown in Figure 10.5 will appear. After user entering the message and click OK, the message will be displayed on the caption, if he click Cancel, "No message" will be displayed.

No comments:

Post a Comment