473,513 Members | 2,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tooltips not showing on Toolbar buttons w/o focus

I added a toolbar to a form and added one button. I made sure ShowToolTips
= true for the Toolbar, and have set a tooltip for the button.

The problem is the tooltip only shows after clicking somewhere on the
toolbar itself. It seems it needs to have the focus before tooltips will
show.

Any ideas?

Greg

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents ToolBar1 As System.Windows.Forms.ToolBar
Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.ToolBar1 = New System.Windows.Forms.ToolBar
Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton
Me.SuspendLayout()
'
'ToolBar1
'
Me.ToolBar1.Buttons.AddRange(New
System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1})
Me.ToolBar1.DropDownArrows = True
Me.ToolBar1.Location = New System.Drawing.Point(0, 0)
Me.ToolBar1.Name = "ToolBar1"
Me.ToolBar1.ShowToolTips = True
Me.ToolBar1.Size = New System.Drawing.Size(292, 42)
Me.ToolBar1.TabIndex = 0
'
'ToolBarButton1
'
Me.ToolBarButton1.Text = "Test"
Me.ToolBarButton1.ToolTipText = "Test"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.ToolBar1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)

End Sub

#End Region

End Class
Nov 19 '05 #1
2 5697
Hello,

"Greg Burns" <gr********@hotmail.com> schrieb:
I added a toolbar to a form and added one button. I made sure
ShowToolTips = true for the Toolbar, and have set a tooltip for the button.
The problem is the tooltip only shows after clicking somewhere on the
toolbar itself. It seems it needs to have the focus before tooltips will
show.


I was not able to reproduce that using your code on a Windows XP
Professional machine running .NET 1.0.

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #2
I have been having the exact same problem. If anyone has a solution,
that would be great!
"Greg Burns" <gr********@hotmail.com> wrote in message news:<OD*************@TK2MSFTNGP10.phx.gbl>...
I added a toolbar to a form and added one button. I made sure ShowToolTips
= true for the Toolbar, and have set a tooltip for the button.

The problem is the tooltip only shows after clicking somewhere on the
toolbar itself. It seems it needs to have the focus before tooltips will
show.

Any ideas?

Greg

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents ToolBar1 As System.Windows.Forms.ToolBar
Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.ToolBar1 = New System.Windows.Forms.ToolBar
Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton
Me.SuspendLayout()
'
'ToolBar1
'
Me.ToolBar1.Buttons.AddRange(New
System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1})
Me.ToolBar1.DropDownArrows = True
Me.ToolBar1.Location = New System.Drawing.Point(0, 0)
Me.ToolBar1.Name = "ToolBar1"
Me.ToolBar1.ShowToolTips = True
Me.ToolBar1.Size = New System.Drawing.Size(292, 42)
Me.ToolBar1.TabIndex = 0
'
'ToolBarButton1
'
Me.ToolBarButton1.Text = "Test"
Me.ToolBarButton1.ToolTipText = "Test"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.ToolBar1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)

End Sub

#End Region

End Class

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5309
by: M-a-S | last post by:
How can I have tooltips for buttons of a toolbar or for control items of a dialog? Does such feature exist at all? M-a-S
9
3485
by: Terrance | last post by:
Good Afternoon: I was hoping if someone could share some light on a problem that I'm facing. When I create a Visual Basic.Net program and I use the XP style for my Window Forms and buttons; if I...
1
327
by: Arif | last post by:
I have a bizarre problem. I am using a code module to update the Caption property of the buttons of a custom toolbar. Though the code module works fine, the new caption does not immediately show on...
2
1976
by: Billy Greening | last post by:
Hi, I have attached tooltips to some buttons on my toolbar, but the tooltips at some times are showing up behind the form. When I hover over the button on the far right of my toolbar, I can see...
3
1729
by: Ellis Yu | last post by:
Dear all, I want to have a toolbar in the main (central) form of an MDI application. All child forms have 5 common buttons for specific jobs like SAVE, NEW etc. So when the user is in the child...
2
2065
by: Ken Kazinski | last post by:
How do you set the tool tip property on a button. This was easy in VB6. Here is the code I am trying to use. Dim toolTip1 As New ToolTip() ' Set up the delays for the ToolTip....
1
1791
by: TyBreaker | last post by:
I have a simple form with a toolstrip on it and some toolstrip buttons. Tooltips work fine. But then I use the ShAppBarMessage API call to register the form as an Application Desktop Toolbar. ...
2
2164
by: Element | last post by:
I have a master form with a simple subform that displays line items in datasheet mode. Everything works fine, except that when the subform has the focus, the standard Access sorting and filtering...
0
7161
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.