Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a form with the following 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?

Posted

Thank's PlausiblyDamp your prompt reply.

 

It helped a lot.

 

I had to include my tourno as .Text for the labels and sender then reacts with that information:

System.Windows.Forms.TextBox, Text: Tour6

 

It's was then simple to pick-out the required tour number (6 in example)

 

May be not the most intelligent way but it works :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...