473,395 Members | 1,738 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,395 software developers and data experts.

how to dynamically set tootip on listbox?

GS
how can I set tooTip on ToolTip1 for a listbox?
Dec 26 '07 #1
6 7194
On Dec 26, 8:42 pm, "GS" <gsmsnews.microsoft.co...@msnews.Nomail.com>
wrote:
how can I set tooTip on ToolTip1 for a listbox?
If you're meaning associating a tooltip with a control, simple drag a
tooltip from toolbox on your project then go to your control's
properties(eg: a button) and set " eg: tooltip on tooltip 1" property
text what you want.
Dec 26 '07 #2
GS
actually, I already have tootip1 as created like you describe.
I was attempting to set the tootip dynamically based on the scrolling/item
selected on the listbox.
I guess that is not possible, so I just gave up and set the tag instead. the
user would have to request help on the listbox 1 to see the new dynamic help
content

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:33**********************************@p69g2000 hsa.googlegroups.com...
On Dec 26, 8:42 pm, "GS" <gsmsnews.microsoft.co...@msnews.Nomail.com>
wrote:
how can I set tooTip on ToolTip1 for a listbox?

If you're meaning associating a tooltip with a control, simple drag a
tooltip from toolbox on your project then go to your control's
properties(eg: a button) and set " eg: tooltip on tooltip 1" property
text what you want.

Dec 27 '07 #3
It should be possible to dynamically pop up specific text in your
tooltip. I did this in a small map control i did. Basically i hooked
into the mouse move event for the control you are interested in. In the
event handler i looked to see if the tooltip was active. If active i
then analyzed where the mouse was in the control. I was able then to get
the specific information about the item that was under the mouse. You
can then set the text in the tooltip and display it. Following is the
code where i set the contents of the tool tip. It is taken out of
context but hopefully gives you the idea.
ToolTip tt = mapControl.toolTip1;
RectangleF rec = new RectangleF(x - 2,y - 2,4,4);
PointF pt = MapToScreen(mob.x,mob.y);
if (rec.Contains(pt))
{
tt.SetToolTip(mapControl, mob.TargetInfo());
tt.AutomaticDelay = 0;
tt.Active = true;
}

TargetInfo can create a pretty complex set of text. It uses a
StringBuilder to do that and you can use multiple lines of text by
Appending \n characters.

Hope this helps
Leon Lambert

GS wrote:
actually, I already have tootip1 as created like you describe.
I was attempting to set the tootip dynamically based on the scrolling/item
selected on the listbox.
I guess that is not possible, so I just gave up and set the tag instead. the
user would have to request help on the listbox 1 to see the new dynamic help
content

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:33**********************************@p69g2000 hsa.googlegroups.com...
>On Dec 26, 8:42 pm, "GS" <gsmsnews.microsoft.co...@msnews.Nomail.com>
wrote:
>>how can I set tooTip on ToolTip1 for a listbox?
If you're meaning associating a tooltip with a control, simple drag a
tooltip from toolbox on your project then go to your control's
properties(eg: a button) and set " eg: tooltip on tooltip 1" property
text what you want.

Dec 27 '07 #4
GS
thank you for the example code. I will give it a shot later after finishing
up the main functionalities.

I assume mob is the mouse object right?

"Leon Lambert" <la******@inil.comwrote in message
news:ei**************@TK2MSFTNGP02.phx.gbl...
It should be possible to dynamically pop up specific text in your
tooltip. I did this in a small map control i did. Basically i hooked
into the mouse move event for the control you are interested in. In the
event handler i looked to see if the tooltip was active. If active i
then analyzed where the mouse was in the control. I was able then to get
the specific information about the item that was under the mouse. You
can then set the text in the tooltip and display it. Following is the
code where i set the contents of the tool tip. It is taken out of
context but hopefully gives you the idea.
ToolTip tt = mapControl.toolTip1;
RectangleF rec = new RectangleF(x - 2,y - 2,4,4);
PointF pt = MapToScreen(mob.x,mob.y);
if (rec.Contains(pt))
{
tt.SetToolTip(mapControl, mob.TargetInfo());
tt.AutomaticDelay = 0;
tt.Active = true;
}

TargetInfo can create a pretty complex set of text. It uses a
StringBuilder to do that and you can use multiple lines of text by
Appending \n characters.

Hope this helps
Leon Lambert

GS wrote:
actually, I already have tootip1 as created like you describe.
I was attempting to set the tootip dynamically based on the
scrolling/item
selected on the listbox.
I guess that is not possible, so I just gave up and set the tag instead.
the
user would have to request help on the listbox 1 to see the new dynamic
help
content

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:33**********************************@p69g2000 hsa.googlegroups.com...
On Dec 26, 8:42 pm, "GS" <gsmsnews.microsoft.co...@msnews.Nomail.com>
wrote:
how can I set tooTip on ToolTip1 for a listbox?
If you're meaning associating a tooltip with a control, simple drag a
tooltip from toolbox on your project then go to your control's
properties(eg: a button) and set " eg: tooltip on tooltip 1" property
text what you want.

Dec 27 '07 #5
No mob actually stand for Mobile Object. These are points of interest on
my map control.

Leon Lambert

GS wrote:
thank you for the example code. I will give it a shot later after finishing
up the main functionalities.

I assume mob is the mouse object right?

"Leon Lambert" <la******@inil.comwrote in message
news:ei**************@TK2MSFTNGP02.phx.gbl...
>It should be possible to dynamically pop up specific text in your
tooltip. I did this in a small map control i did. Basically i hooked
into the mouse move event for the control you are interested in. In the
event handler i looked to see if the tooltip was active. If active i
then analyzed where the mouse was in the control. I was able then to get
the specific information about the item that was under the mouse. You
can then set the text in the tooltip and display it. Following is the
code where i set the contents of the tool tip. It is taken out of
context but hopefully gives you the idea.
ToolTip tt = mapControl.toolTip1;
RectangleF rec = new RectangleF(x - 2,y - 2,4,4);
PointF pt = MapToScreen(mob.x,mob.y);
if (rec.Contains(pt))
{
tt.SetToolTip(mapControl, mob.TargetInfo());
tt.AutomaticDelay = 0;
tt.Active = true;
}

TargetInfo can create a pretty complex set of text. It uses a
StringBuilder to do that and you can use multiple lines of text by
Appending \n characters.

Hope this helps
Leon Lambert

GS wrote:
>>actually, I already have tootip1 as created like you describe.
I was attempting to set the tootip dynamically based on the
scrolling/item
>>selected on the listbox.
I guess that is not possible, so I just gave up and set the tag instead.
the
>>user would have to request help on the listbox 1 to see the new dynamic
help
>>content

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:33**********************************@p69g2000 hsa.googlegroups.com...
>>>On Dec 26, 8:42 pm, "GS" <gsmsnews.microsoft.co...@msnews.Nomail.com>
wrote:
how can I set tooTip on ToolTip1 for a listbox?
If you're meaning associating a tooltip with a control, simple drag a
tooltip from toolbox on your project then go to your control's
properties(eg: a button) and set " eg: tooltip on tooltip 1" property
text what you want.

Dec 28 '07 #6
GS
Great. I finally got around to try out your hint. thanks to your hint..

It turns out to be real easy, nothing complicated for listbox nor textbox
controls

just add another tootip
in the control's hover event
ToolTip tt = toolTip2;
tt.SetToolTip(regexOptionListBox,
regexOptionListBox.Tag.ToString());
tt.AutomaticDelay = 0;
tt.Active = true;
for a simplified example.

To make tt context sensitive to selected listbox , I will have to use the
selected value for setToolTip accordingly instead of the tag.

I also found out
ToolTip tt = toolTip2;
is critical as direct use of toolTip2.SetToolTip(...) is not acceptable!

"Leon Lambert" <la******@inil.comwrote in message
news:ei**************@TK2MSFTNGP02.phx.gbl...
It should be possible to dynamically pop up specific text in your
tooltip. I did this in a small map control i did. Basically i hooked
into the mouse move event for the control you are interested in. In the
event handler i looked to see if the tooltip was active. If active i
then analyzed where the mouse was in the control. I was able then to get
the specific information about the item that was under the mouse. You
can then set the text in the tooltip and display it. Following is the
code where i set the contents of the tool tip. It is taken out of
context but hopefully gives you the idea.
ToolTip tt = mapControl.toolTip1;
RectangleF rec = new RectangleF(x - 2,y - 2,4,4);
PointF pt = MapToScreen(mob.x,mob.y);
if (rec.Contains(pt))
{
tt.SetToolTip(mapControl, mob.TargetInfo());
tt.AutomaticDelay = 0;
tt.Active = true;
}

TargetInfo can create a pretty complex set of text. It uses a
StringBuilder to do that and you can use multiple lines of text by
Appending \n characters.

Hope this helps
Leon Lambert

GS wrote:
actually, I already have tootip1 as created like you describe.
I was attempting to set the tootip dynamically based on the
scrolling/item
selected on the listbox.
I guess that is not possible, so I just gave up and set the tag instead.
the
user would have to request help on the listbox 1 to see the new dynamic
help
content

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:33**********************************@p69g2000 hsa.googlegroups.com...
On Dec 26, 8:42 pm, "GS" <gsmsnews.microsoft.co...@msnews.Nomail.com>
wrote:
how can I set tooTip on ToolTip1 for a listbox?
If you're meaning associating a tooltip with a control, simple drag a
tooltip from toolbox on your project then go to your control's
properties(eg: a button) and set " eg: tooltip on tooltip 1" property
text what you want.

Dec 30 '07 #7

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

Similar topics

5
by: Lukelrc | last post by:
Hi, I have a dynamically created listbox. I'm trying to get one of the options selected according to a passed value. This is what i have: <select name="txtTheme" id="txtTheme"> ...
2
by: JJ | last post by:
I am populating a listbox with Items dynamically during run time. That is fine!!!. How can I add an image to (just one standard) to each item in the list box dynamically. Thnaks JJ
1
by: mlarson | last post by:
Hello, I'm working on a page that dynamically creates listboxes and the "options" that are added to the listbox. A user can then click on buttons to either add or delete the "options" from one...
3
by: John | last post by:
Hi everyone, I have a asp.net listbox (lstAvailable) that is populated via as ADO DataSet. lstAvailable.DataSource = oDs lstAvailable.DataTextField = oDs.Tables(0).Columns(0).ToString ...
6
by: Papa.Coen | last post by:
I've just spend a lot of time solving the following problem: I used dotNet 2.0 / Visualstudio 2005 / C# / aspx, enable viewstate is set on all controls. I have 2 listboxes; the left contains items...
5
by: Arpan | last post by:
In order to populate any server control with data dynamically, is it ALWAYS NECESSARY to either BIND the DataSource to that server control or call the DataBind method of that server control? For...
9
by: Suman | last post by:
Happy Friday everyone!!! I am working on a windows service and a C# application and needed some help with certain functionality. Please read through my issue below. Thanks! I have a windows...
1
by: stimul8d | last post by:
okay; ASP. I have i listbox inside a user control which is dynamically created on page_init. I check for postback and only populate the datasource if it's false. regardless, i do this ...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...

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.