Tooltip in user controls

B

Bharathi kumar

Hi,

I have a usercontrol (UsrCtrl1) that contains some labels.

I have another user control (UsrCtrl2) where I have six UsrCtrl1
controls named objUsrCtrl1 to objUsrCtrl6.

I have added a Tooltip instance in the UsrCtrl2.

ToolTip1.Active = True

Public Sub objUsrCtrl1_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles objUsrCtrl1.MouseEnter
ToolTip1.Show(GetToolTipFortheCtrl(objUsrCtrl1.Myval), Me, 5000)
End Sub

Private Function GetToolTipFortheCtrl(ByVal val As Myvalclass) As
String

Return val. Name & vbCrLf _
& "Property1: " & val.Property1 & vbCrLf _
& "Property2: " & val.Property2 & vbCrLf _
& "Property3: " & val.Property3 & vbCrLf _
& "Property4: " & val.Property4
End Function

(For some reason I don't want to give the original method names &
properties I have used.)

Similar to objUsrCtrl1_MouseEnter procedure, I have procedures for
the other five user controls(objUsrCtrl2 to objUsrCtrl6) in UsrCtrl2.

In my windows application in a form I have 5 or more instances of
UsrCtrl2. (This count is not fixed.)

There are several threads in my form & they do some functionality. This
takes several hours to complete. While the process is running the
values are updated in User controls.

While the process is going on if the user mouse overs on the control,
the pop up is not coming regularly. I mean sometimes the tool tip shows
up and sometimes there is no tool tip message.

Showing tool tip is of high preference to me. Is there a way to show
the tool-tip immediately when there is mouse-over on the control.

I have tried using MouseHover procedure also instead of MouseOver.
Still the problem is there. If UI thread is busy doing some work, does
it mean it can't show tool-tip at that time. If this is true, how can
I solve my problem. Please help.


(My user control inherits from System.Windows.Forms.UserControl)

Regards,
Bharathi.
 
B

Bharathi kumar

Hi,

I am sorry if my question confuses anyone. Ok. I am working on a
windows application project in VS.NET 2005. From next time onwards I
think I can post in right group.

The solution to my problem is really simple. I am giving the solution
here. It may be helpful for someone who have the same problem.

My user control "UsrCtrl1" has some labels. I made them as public and
added the same code to labels also.

Thank you very much,
Regards,
Bharathi Kumar.
 

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

Top