I have a form with the following code:
Please observe that the .Location data are calculated before the shown code.
Based upon date/time data, the code generates red bars on my form - each position and lenght is determed by the date/time data.
The AddHandler for click works great, but a bit tricky in that I am using the Me.ActiveControl.Tabindex data to determ which bar was actually clicked, but I could not find a better solution.
Now I want to add a function which will display the actual date/time data when a specific bar is mouse hovered.
So I need to detect the TourCount numbers specified in the AddHandler code lines when the TourGE, TourShow or TourHide events are fired.
How to do that?
Code:
Public TourBars As New Generic.List(Of TextBox)
------------------------------------
For TourCount 0 to 9
TourBars.Add(New TextBox)
With TourBars(TourCount)
.Location = New Point(Xstart + SinceMidnight / 86400 * Xlength, Ystart + 2 + Yoffset * LineNo)
.Height = 14
.Width = 600 * Duration / 86400
.BackColor = Color.Red
.Cursor = Cursors.Hand
.TabIndex = 1000 + TourCount
.Multiline = True
.BorderStyle = BorderStyle.None
End With
Me.Controls.Add(TourBars(TourCount))
AddHandler TourBars(TourCount).Click, AddressOf TourGE
AddHandler TourBars(TourCount).MouseHover, AddressOf Tourshow
AddHandler TourBars(TourCount).MouseLeave, AddressOf TourHide
Next
Please observe that the .Location data are calculated before the shown code.
Based upon date/time data, the code generates red bars on my form - each position and lenght is determed by the date/time data.
The AddHandler for click works great, but a bit tricky in that I am using the Me.ActiveControl.Tabindex data to determ which bar was actually clicked, but I could not find a better solution.
Now I want to add a function which will display the actual date/time data when a specific bar is mouse hovered.
So I need to detect the TourCount numbers specified in the AddHandler code lines when the TourGE, TourShow or TourHide events are fired.
How to do that?