Finding out which Control was activated

R

ree32

Say I have function which handles events. Suppose I have 2 calendars
where an a date is elected it activates this function.
Sub calStartSelected(ByVal sender As Object, ByVal e As EventArgs)

Is there anyway using the object sender I can findout which calendar
was selected. Say the names of the calenders are cal1 and cal2.

Thanks
 
W

Wessam Zeidan

you can cast the sender to Calendar and check the ID


Dim c as Calendar=CType(sender,Calendar)
If c.ID="yourcanlenderid" Then
''do something
End IF
 
R

ree32

you can cast the sender to Calendar and check the ID


Dim c as Calendar=CType(sender,Calendar)
If c.ID="yourcanlenderid" Then
''do something
End IF

where do i get the "yourcanlenderid" from?
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top