473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

handling click event on a label

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?
Nov 21 '05 #1
2 1708
Stefano wrote:
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
Nov 21 '05 #2
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

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul E. Orman | last post by:
I have a piece of VB code (.NET 1.1 - VB 2003) that loads data from a database through a timer. So the timer is setup and from it I call the procedure that loads the latest records from the...
2
by: Tamir Khason | last post by:
I build user control, consists of different things (e.g label, image, etc.) I want to handle click (and other) events, however I can not do it until I do not assign event handler for each control...
2
by: Eric Newton | last post by:
VB's more declarative nature of handling events is golden. I'm hoping C# will acquire this type of deal, in addition to the anonymous delegates. could do same as vb (actually would be easier to...
3
by: Neil Wallace | last post by:
Hi, This is an odd one. I've been struggling to get "double click" to work well for my controls. The same event handler works perfectly for buttons, but not for labels. Can anyone tell me...
2
by: semesm22 | last post by:
is there any way that i can create a click event for a label that is part of the web control library....i want to use a label in a user control, and when the user clicks one the user control i...
2
by: Jordan | last post by:
I need to handle UI events in a worker thread instead of the primary UI thread. In C#, is the normal UI event handling behavior to run in a context thread on the thread pool or are events always...
4
by: reggiestyles | last post by:
Hi, I've got a question about prototype and event handling. I've got several div's (dynamic number) on a page that I want to set as active or inactive (basically, I'm using scriptaculous'...
8
by: BD | last post by:
How can I duplicate the behavior of the operating system shortcut keys in my application? For example, my windows form has 5 controls (textboxes), the operating system will pickup which control...
1
by: raghulvarma | last post by:
I have created a custom control to get the values and sum them, Here I am able to get display the controls but I am not able to add the values in the text box which means that I am not able to catch...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.