473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Show ToolTip on every Control continuously

Hi,

Using VB.NET 2.0, Windows Forms.
I want the ToolTip to be shown on every TextBox, ComboBox and DataGridView
continuously, and show the contence of these controls. Is there a way to add
the ToolTip automaticly for all these controls, without having to link it
the whole time to them for every new Control I put on my Forms?

And regarding the DataGridView: The ToolTip doesn't show the whole value of
every Cell, but cuts it off when it's too long. how to get around this?

Thansk a lot in advance,

Pieter
Oct 19 '06 #1
4 3592
You could use a label.

T

Pieter wrote:
>Hi,

Using VB.NET 2.0, Windows Forms.
I want the ToolTip to be shown on every TextBox, ComboBox and DataGridView
continuously, and show the contence of these controls. Is there a way to add
the ToolTip automaticly for all these controls, without having to link it
the whole time to them for every new Control I put on my Forms?

And regarding the DataGridView: The ToolTip doesn't show the whole value of
every Cell, but cuts it off when it's too long. how to get around this?

Thansk a lot in advance,

Pieter

Oct 19 '06 #2
Hi Pieter,

For automatically initializing all tooltip for all the components on
your form try calling this procedure from the Form1_load event:

Private Sub SetToolTips()
Dim i As Control
For Each i In Me.Controls
ToolTip1.SetToolTip(i,
i.ToString.Substring(i.ToString.IndexOf("Text:") + 5))
Next
End Sub

If you test this with the caption just "i.tostring", you'll see why I
parsed the control.tostring in this way.

I'm not sure if there is a less intensive way to automatically update
the tooltip text in the event of a change without writing an individual
event handler for each control.

Regarding the DataGridView cells question, I'm not sure what you mean.
What are you trying to do, and what does the application show? Are you
building the Tooltip caption?

Regards,
Keith

Pieter wrote:
Hi,

Using VB.NET 2.0, Windows Forms.
I want the ToolTip to be shown on every TextBox, ComboBox and DataGridView
continuously, and show the contence of these controls. Is there a way to add
the ToolTip automaticly for all these controls, without having to link it
the whole time to them for every new Control I put on my Forms?

And regarding the DataGridView: The ToolTip doesn't show the whole value of
every Cell, but cuts it off when it's too long. how to get around this?

Thansk a lot in advance,

Pieter
Oct 19 '06 #3
I don't think what you want to do is possible. The Tooltip window is usually
a single instance of a simple window that shows a string which it gets by
looking at a record in a hashtable which is associated with a control. To
show a whole lot of windows from this one object and to show more than one
string at a time is pretty well impossible.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Pieter" <pi****************@hotmail.comwrote in message
news:ui**************@TK2MSFTNGP04.phx.gbl...
Hi,

Using VB.NET 2.0, Windows Forms.
I want the ToolTip to be shown on every TextBox, ComboBox and DataGridView
continuously, and show the contence of these controls. Is there a way to
add the ToolTip automaticly for all these controls, without having to link
it the whole time to them for every new Control I put on my Forms?

And regarding the DataGridView: The ToolTip doesn't show the whole value
of every Cell, but cuts it off when it's too long. how to get around this?

Thansk a lot in advance,

Pieter

Oct 19 '06 #4

This would work well unless the control is belong to a secondary
container like Panel or GroupBox. I guess that you don't want to show
tooltip for every control (like Panel, etc.) so you may need some "if"s
inside. Something like the following would do the job:

Private Sub SetToolTips(ByVal ctrl as Control)
{
if typeof ctrl is Form OrElse typeof ctrl is Panel OrElse ... then
' do nothing
else if typeof ctrl is DataGridView/listview/treeview then
' do something as per requirements
else ' other control, just set text
toolTip1.SetToolTip(ctrl, ctrl.Text);
end if

for each child as Control in ctrl.Controls
SetToolTips(child) ' recursive
next
}

Then, in constructor or form load, you could call SetToolTips(Me).

Thi

kgerritsen wrote:
Hi Pieter,

For automatically initializing all tooltip for all the components on
your form try calling this procedure from the Form1_load event:

Private Sub SetToolTips()
Dim i As Control
For Each i In Me.Controls
ToolTip1.SetToolTip(i,
i.ToString.Substring(i.ToString.IndexOf("Text:") + 5))
Next
End Sub

If you test this with the caption just "i.tostring", you'll see why I
parsed the control.tostring in this way.

I'm not sure if there is a less intensive way to automatically update
the tooltip text in the event of a change without writing an individual
event handler for each control.

Regarding the DataGridView cells question, I'm not sure what you mean.
What are you trying to do, and what does the application show? Are you
building the Tooltip caption?

Regards,
Keith

Pieter wrote:
Hi,

Using VB.NET 2.0, Windows Forms.
I want the ToolTip to be shown on every TextBox, ComboBox and DataGridView
continuously, and show the contence of these controls. Is there a way to add
the ToolTip automaticly for all these controls, without having to link it
the whole time to them for every new Control I put on my Forms?

And regarding the DataGridView: The ToolTip doesn't show the whole value of
every Cell, but cuts it off when it's too long. how to get around this?

Thansk a lot in advance,

Pieter
Oct 20 '06 #5

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

Similar topics

6
by: Robert | last post by:
Hello. I have been trying out the Lebans ToolTip Classes at http://www.lebans.com/tooltip.htm, to display "balloon" style help tips in a form. The classes I am using are located at...
3
by: Mr.Tickle | last post by:
How can I get the tooltip in a generic way for any control that the mouse is hovering over in a single application, I dont want to have to code the MouseHover event handler on every form.
3
by: RJN | last post by:
Hi The texts in the dropdown are too long and the width is not sufficient to show the entire text. Increasing the width is not an option. Is there a way to show the selected item text as a...
2
by: Ken | last post by:
Hi all, Please help! I'm attempting to apply tooltips to each individual item in VB.Net's Listview control. In VB6 it was easy - you just did the following (assumes "myListView" is the name of...
0
by: Lucian Wischik | last post by:
I'm using ToolTip.Show(x,y,..) to show my balloon-style tooltip at a specified coordinate. Most of the time it works fine and the "tip" of the balloon points exactly to my specified (x,y)...
2
by: Paul E Collins | last post by:
How can I show a tooltip programmatically? I want to make it appear over a particular control at the specific time I choose, and not rely on the user's mouse movements. I don't mind using some...
4
by: Pieter | last post by:
Hi, Using VB.NET 2.0, Windows Forms. I want the ToolTip to be shown on every TextBox, ComboBox and DataGridView continuously, and show the contence of these controls. Is there a way to add the...
1
by: tru | last post by:
i am doing software in "vb.net" i want to show map of maharashtra on frontscreen of my application. i can give that map as image to picturebox. but i want to show rainfall percentage at particular...
7
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello, I'm using the ToolTip control, but I want it to behave a bit different. I want the toolTip to popup not only once when the control is enter and the mouse is stationary. I want the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.