Erikvandervelde Posted May 28, 2003 Posted May 28, 2003 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 Quote
*Gurus* divil Posted May 29, 2003 *Gurus* Posted May 29, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Erikvandervelde Posted June 6, 2003 Author Posted June 6, 2003 Dear Divil, I don't know even where to start... How do I implement the Win32 api tooltip??? Can you give me a simple example to get me started. Thanks so far... Erik Quote
*Gurus* divil Posted June 6, 2003 *Gurus* Posted June 6, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Erikvandervelde Posted June 6, 2003 Author Posted June 6, 2003 Hi Divil, I'll take al look on MSDN to find some information. Thanks so far! If you have a example or a URL for me. Please post it here. Erik Quote
*Gurus* divil Posted June 6, 2003 *Gurus* Posted June 6, 2003 I've posted a sample for you in the code library, it should be more than enough to get you started. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.