|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Referencing object of same namePrivate WithEvents Appt As Calendar.Apptmnt Private Sub Panel2_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel2.MouseDoubleClick static idx as integer Appt = New Calendar.Apptmnt Appt.Name = idx idx = idx + 1 Panel2.Controls.Add(Appt) AddHandler Appt.MouseUp, AddressOf Appt_myMouseUp AddHandler Appt.MouseDown, AddressOf Appt_myMouseDown AddHandler Appt.MouseMove, AddressOf Appt_myMouseMove End Sub Based on the above code, how do I refer to individual Appt when I want to reference them during mouse_move event. I know how to reference the current one I clicked, that is by using DirectCast in the event. But how about the ones that are not in focus. You have made it private on global level of your class, therefore appt is
accessible in your complete class. Show quoteHide quote "tsluu" <ts***@discussions.microsoft.com> wrote in message news:72FD405A-BCF8-4C58-8BEB-5CC120DF439E@microsoft.com... > public class form1 > > Private WithEvents Appt As Calendar.Apptmnt > > Private Sub Panel2_MouseDoubleClick(ByVal sender As Object, ByVal e As > System.Windows.Forms.MouseEventArgs) Handles Panel2.MouseDoubleClick > static idx as integer > Appt = New Calendar.Apptmnt > Appt.Name = idx > idx = idx + 1 > > Panel2.Controls.Add(Appt) > > AddHandler Appt.MouseUp, AddressOf Appt_myMouseUp > AddHandler Appt.MouseDown, AddressOf Appt_myMouseDown > AddHandler Appt.MouseMove, AddressOf Appt_myMouseMove > End Sub > > Based on the above code, how do I refer to individual Appt when I want to > reference them during mouse_move event. I know how to reference the > current > one I clicked, that is by using DirectCast in the event. But how about the > ones that are not in focus.
VS2008 : Error Using IIF in Select Query
What are HashTables good for? winmm book? writing to file from web service Client Server app using winsock setting a timeout for web service response NNTP [XPost] - Visual Studio 2008 - Instruct IDE Not To Generate Adapter Session Variables in asp.net cancelling a backgroundworker |
|||||||||||||||||||||||