Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

declaring display.caption for a msg box

Status
Not open for further replies.
Jun 4, 2003
18
GB
im attempting to create small program with a message box appearing but am having trouble with the display.caption bit:

Private Sub Test_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Test.Click
Dim testmsg As Integer
Dim Display As
testmsg = MsgBox("Click to test", 1, "Test Message")
If testmsg = 1 Then
Display.Caption = "Testing Successful"
Else
Display.Caption = "Testing Fail"
End If
End Sub

the problem is it says the word Display has not been declared, but from the notes ive got it doesnt need to be. can anyone help? what should i declare it as???

thanks
 
Display looks like it could be a label object. Make sure that a label object named 'Display' exists on the form.

Thanks and Good Luck!

zemp
 
>>Private Sub Test_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Test.Click

This looks more like VB .NET code than it does VB 5 or 6.


Not too familiar with that, but what does this line do:
Dim Display As ?

Looks like an incomplete declaration...

Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top