handling click event on a label

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've written a simple application for a Pocket PC 2003 with the .NET Compact
Framework and Visual Basic .NET. In the main form I've added a label named
"lblTest" and I need to handle the event "click" on this label to write a
simple message on a MsgBox...
I've tried this code:

Private Sub lblTest_Click(...)
MsgBox (...)
End Sub

But when I debug the application nothing happends when I make click on this
label and I don't understand why...can anybody help me?
 
Stefano said:
I've written a simple application for a Pocket PC 2003 with the .NET Compact
Framework and Visual Basic .NET. In the main form I've added a label named
"lblTest" and I need to handle the event "click" on this label to write a
simple message on a MsgBox...
I've tried this code:

Private Sub lblTest_Click(...)
MsgBox (...)
End Sub

But when I debug the application nothing happends when I make click on this
label and I don't understand why...can anybody help me?

Try:
Private Sub lblTest_Click(...) handles lblTest.Click
MsgBox (...)
End Sub

Or in your form_load do:

AddHandler lblTest.Click, addessof lblTest_Click

Good Luck
Chris
 
I've tried your code but nothing change...
When I made the click on the label nothing happends...

This is my code, I hope anybody can help me...I'm thinking that a label
cannot be clicked on windows 2003 mobile or the event is not hadled by
system...

Private Sub Form_Load(...) Handles MyBase.Load
AddHandler lblTest.Click, AddressOf lblTest_Click
End Sub

Private lblTest_Click (...) Handles lblTest.Click
MessageBox.Show("You've clicked Test label!")
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top