Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi there!

 

I'm writing a usercontrol wich contains multiple buttons which I draw usering GDI+.

It aren't actually buttons (controls) but i just draw them.

Now i want to show a tooltip if the mouse moves over a button.

I tried to do this on the mousemove event:

 

Protected Overrides Sub OnMouseMove(ByVal e As system.Windows.Forms.MouseEventArgs)

 

Dim MyButton As OutlookBarButton

Me.MyTooltip.RemoveAll()

For Each Button In Me.buttons

If MyButton.Bounds.Contains(e.x, e.y) Then

Me.MyTooltip.SetToolTip(Me, MyButton.Title)

End If

Next

End sub

 

But this won't work.

The control doesn't show a tooltip at all.

How should I do this?!

Please understand that MyButton is NOT a control, but just a class.

So Me.mytooltip.SetToolTip(MyButton, MyButton.title) is not possible!

 

I hope someone can help me out!

 

Erik

  • *Gurus*
Posted

There is no .NET tooltip wrapper for implementing regional tooltips for a control. When I had to implement them in my toolbar control I had to use the win32 api tooltips through platform invoke, there is a fair amount of information in msdn on getting them working.

 

If you get stuck, post in this thread and I'll help.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

  • 2 weeks later...
  • *Gurus*
Posted
I'm afraid there is no simple example, if I have time I'll try to knock up a sample for you. You'll have to be familiar with Platform Invoke and do some reading of MSDN on the various messages you send to establish a tooltip window and configure regions.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

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...