By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Custom Control and ToolTips?

P: n/a
Hello all,

[Sorry for x-posting but did not know in which group someone could help me]

I've created a custom control that draws a monthly schedule (using the Draw
function in C#). Basically it draws 31 boxes and writes the day number in
every box.

This works great. But I now want to show a different tooltip for every day.
For now I found out that I can add a tooltip for the entire custom control
but how to create a tooltip for every box that I've drawn in my custom
control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus
Nov 17 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
Hi,

Some possibilities;
1) You may already tested this but in case of you don't; Don't draw boxes,
create every box dynamicaly from a control. You can then set seperated
tooltips for every box. In my opinion, if you don't have performance
problems every single day should be a class and it would best described with
a user/custom control.
2) Make your own custom tooltip control from a label or something else and
show it at the calculated positions. A timer control should be enough to
show/hide it after a while.
3) As an idea; Build an invisible user/custom control and assign your
tooltip. Reposition it right under your mouse pointer if the pointer is over
a box, it will display the tooltip. (You can limit the draw region to become
an invisible control)

Good Luck,
Adnan
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help me]

I've created a custom control that draws a monthly schedule (using the Draw
function in C#). Basically it draws 31 boxes and writes the day number in
every box.

This works great. But I now want to show a different tooltip for every day.
For now I found out that I can add a tooltip for the entire custom control
but how to create a tooltip for every box that I've drawn in my custom
control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus

Nov 17 '05 #2

P: n/a
Hi,

Some possibilities;
1) You may already tested this but in case of you don't; Don't draw boxes,
create every box dynamicaly from a control. You can then set seperated
tooltips for every box. In my opinion, if you don't have performance
problems every single day should be a class and it would best described with
a user/custom control.
2) Make your own custom tooltip control from a label or something else and
show it at the calculated positions. A timer control should be enough to
show/hide it after a while.
3) As an idea; Build an invisible user/custom control and assign your
tooltip. Reposition it right under your mouse pointer if the pointer is over
a box, it will display the tooltip. (You can limit the draw region to become
an invisible control)

Good Luck,
Adnan
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help me]

I've created a custom control that draws a monthly schedule (using the Draw
function in C#). Basically it draws 31 boxes and writes the day number in
every box.

This works great. But I now want to show a different tooltip for every day.
For now I found out that I can add a tooltip for the entire custom control
but how to create a tooltip for every box that I've drawn in my custom
control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus

Nov 17 '05 #3

P: n/a
Adnan,

Thanks for your help....
1) Hmmmm, this would mean that I must recreate the entire control (and I'm
already so far :-( )
2) Can you be more specific how to do this? I've tried to create a new form
with no border and show it using the MouseHover (and MouseMove) events. The
problem is that when I show the form it has the focus and can't get back to
my control.....
3) Is a dirty workable way, but I don't like it to much.

I'm still learning C# so bear with me :-)

Thanks again!
Tinus

"adnan boz" <ab*********@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP10.phx.gbl...
Hi,

Some possibilities;
1) You may already tested this but in case of you don't; Don't draw boxes,
create every box dynamicaly from a control. You can then set seperated
tooltips for every box. In my opinion, if you don't have performance
problems every single day should be a class and it would best described
with
a user/custom control.
2) Make your own custom tooltip control from a label or something else and
show it at the calculated positions. A timer control should be enough to
show/hide it after a while.
3) As an idea; Build an invisible user/custom control and assign your
tooltip. Reposition it right under your mouse pointer if the pointer is
over
a box, it will display the tooltip. (You can limit the draw region to
become
an invisible control)

Good Luck,
Adnan
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw
function in C#). Basically it draws 31 boxes and writes the day number in
every box.

This works great. But I now want to show a different tooltip for every
day.
For now I found out that I can add a tooltip for the entire custom control
but how to create a tooltip for every box that I've drawn in my custom
control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus

Nov 17 '05 #4

P: n/a
Adnan,

Thanks for your help....
1) Hmmmm, this would mean that I must recreate the entire control (and I'm
already so far :-( )
2) Can you be more specific how to do this? I've tried to create a new form
with no border and show it using the MouseHover (and MouseMove) events. The
problem is that when I show the form it has the focus and can't get back to
my control.....
3) Is a dirty workable way, but I don't like it to much.

I'm still learning C# so bear with me :-)

Thanks again!
Tinus

"adnan boz" <ab*********@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP10.phx.gbl...
Hi,

Some possibilities;
1) You may already tested this but in case of you don't; Don't draw boxes,
create every box dynamicaly from a control. You can then set seperated
tooltips for every box. In my opinion, if you don't have performance
problems every single day should be a class and it would best described
with
a user/custom control.
2) Make your own custom tooltip control from a label or something else and
show it at the calculated positions. A timer control should be enough to
show/hide it after a while.
3) As an idea; Build an invisible user/custom control and assign your
tooltip. Reposition it right under your mouse pointer if the pointer is
over
a box, it will display the tooltip. (You can limit the draw region to
become
an invisible control)

Good Luck,
Adnan
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw
function in C#). Basically it draws 31 boxes and writes the day number in
every box.

This works great. But I now want to show a different tooltip for every
day.
For now I found out that I can add a tooltip for the entire custom control
but how to create a tooltip for every box that I've drawn in my custom
control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus

Nov 17 '05 #5

P: n/a
Hi,
A form would not be the best solution for a tooltip. Create a user or custom
control instead.
Also u could use a label with FixedSingle border as well. Examine a real
tooltip and its behaviour, u should find out how to build the same.

Good Luck,
Adnan

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in message
news:eW**************@TK2MSFTNGP10.phx.gbl...
Adnan,

Thanks for your help....
1) Hmmmm, this would mean that I must recreate the entire control (and I'm
already so far :-( )
2) Can you be more specific how to do this? I've tried to create a new form
with no border and show it using the MouseHover (and MouseMove) events. The
problem is that when I show the form it has the focus and can't get back to
my control.....
3) Is a dirty workable way, but I don't like it to much.

I'm still learning C# so bear with me :-)

Thanks again!
Tinus

"adnan boz" <ab*********@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP10.phx.gbl...
Hi,

Some possibilities;
1) You may already tested this but in case of you don't; Don't draw boxes,
create every box dynamicaly from a control. You can then set seperated
tooltips for every box. In my opinion, if you don't have performance
problems every single day should be a class and it would best described
with
a user/custom control.
2) Make your own custom tooltip control from a label or something else and
show it at the calculated positions. A timer control should be enough to
show/hide it after a while.
3) As an idea; Build an invisible user/custom control and assign your
tooltip. Reposition it right under your mouse pointer if the pointer is
over
a box, it will display the tooltip. (You can limit the draw region to
become
an invisible control)

Good Luck,
Adnan
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw
function in C#). Basically it draws 31 boxes and writes the day number in
every box.

This works great. But I now want to show a different tooltip for every
day.
For now I found out that I can add a tooltip for the entire custom control
but how to create a tooltip for every box that I've drawn in my custom
control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus


Nov 17 '05 #6

P: n/a
Hi,
A form would not be the best solution for a tooltip. Create a user or custom
control instead.
Also u could use a label with FixedSingle border as well. Examine a real
tooltip and its behaviour, u should find out how to build the same.

Good Luck,
Adnan

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in message
news:eW**************@TK2MSFTNGP10.phx.gbl...
Adnan,

Thanks for your help....
1) Hmmmm, this would mean that I must recreate the entire control (and I'm
already so far :-( )
2) Can you be more specific how to do this? I've tried to create a new form
with no border and show it using the MouseHover (and MouseMove) events. The
problem is that when I show the form it has the focus and can't get back to
my control.....
3) Is a dirty workable way, but I don't like it to much.

I'm still learning C# so bear with me :-)

Thanks again!
Tinus

"adnan boz" <ab*********@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP10.phx.gbl...
Hi,

Some possibilities;
1) You may already tested this but in case of you don't; Don't draw boxes,
create every box dynamicaly from a control. You can then set seperated
tooltips for every box. In my opinion, if you don't have performance
problems every single day should be a class and it would best described
with
a user/custom control.
2) Make your own custom tooltip control from a label or something else and
show it at the calculated positions. A timer control should be enough to
show/hide it after a while.
3) As an idea; Build an invisible user/custom control and assign your
tooltip. Reposition it right under your mouse pointer if the pointer is
over
a box, it will display the tooltip. (You can limit the draw region to
become
an invisible control)

Good Luck,
Adnan
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw
function in C#). Basically it draws 31 boxes and writes the day number in
every box.

This works great. But I now want to show a different tooltip for every
day.
For now I found out that I can add a tooltip for the entire custom control
but how to create a tooltip for every box that I've drawn in my custom
control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus


Nov 17 '05 #7

P: n/a
You can use a single tooltip control and just display it depending on the
location of your cursor, using the Tooltip class. Use the SetTooltip method
to assciate the text with the control. Destroy and recreate the object
everytime your tooltip changes.

James
--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw function in C#). Basically it draws 31 boxes and writes the day
number in every box.

This works great. But I now want to show a different tooltip for every
day. For now I found out that I can add a tooltip for the entire custom
control but how to create a tooltip for every box that I've drawn in my
custom control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus

Nov 17 '05 #8

P: n/a
You can use a single tooltip control and just display it depending on the
location of your cursor, using the Tooltip class. Use the SetTooltip method
to assciate the text with the control. Destroy and recreate the object
everytime your tooltip changes.

James
--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw function in C#). Basically it draws 31 boxes and writes the day
number in every box.

This works great. But I now want to show a different tooltip for every
day. For now I found out that I can add a tooltip for the entire custom
control but how to create a tooltip for every box that I've drawn in my
custom control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus

Nov 17 '05 #9

P: n/a
Ah, yes, offcourse.... that is a good solution and simple.... Thanks James!!

Tinus

"James Westgate" <ja***********@nospam.nospam> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl...
You can use a single tooltip control and just display it depending on the
location of your cursor, using the Tooltip class. Use the SetTooltip
method to assciate the text with the control. Destroy and recreate the
object everytime your tooltip changes.

James
--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw function in C#). Basically it draws 31 boxes and writes the day
number in every box.

This works great. But I now want to show a different tooltip for every
day. For now I found out that I can add a tooltip for the entire custom
control but how to create a tooltip for every box that I've drawn in my
custom control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus


Nov 17 '05 #10

P: n/a
Ah, yes, offcourse.... that is a good solution and simple.... Thanks James!!

Tinus

"James Westgate" <ja***********@nospam.nospam> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl...
You can use a single tooltip control and just display it depending on the
location of your cursor, using the Tooltip class. Use the SetTooltip
method to assciate the text with the control. Destroy and recreate the
object everytime your tooltip changes.

James
--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw function in C#). Basically it draws 31 boxes and writes the day
number in every box.

This works great. But I now want to show a different tooltip for every
day. For now I found out that I can add a tooltip for the entire custom
control but how to create a tooltip for every box that I've drawn in my
custom control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus


Nov 17 '05 #11

P: n/a
James,

I did what you recommended and it works.... however I have a small problem
now and that is that as soon as I enter my 'custom' control the tooltip is
displayed inmediatly :-(

I use the MouseMove event of my custom control to get the location of the
mouse and using that to figure out where the mouse is and what the tooltip
has to display. So in the MouseMove event I set the tooltip using the
SetToolTip function.

I've set the AutoPopDelay to 5000 (5sec) and the InitialDelay and
ReshowDelay to 1000 (1sec). But still the tooltip is display as soon as I
enter the control with the mouse (no 1sec delay :-( ). This is probably
because the SetToolTip function is called as soon as I enter the control
because of the MouseMove event?

If I use the MouseHover event then the tooltip is only displayed once when
the mouse is inside the control...

Do you or someone else have a solution for this?
Thanks in advance!

With regards,
Tinus

"James Westgate" <ja***********@nospam.nospam> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl...
You can use a single tooltip control and just display it depending on the
location of your cursor, using the Tooltip class. Use the SetTooltip
method to assciate the text with the control. Destroy and recreate the
object everytime your tooltip changes.

James
--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw function in C#). Basically it draws 31 boxes and writes the day
number in every box.

This works great. But I now want to show a different tooltip for every
day. For now I found out that I can add a tooltip for the entire custom
control but how to create a tooltip for every box that I've drawn in my
custom control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus


Nov 17 '05 #12

P: n/a
James,

I did what you recommended and it works.... however I have a small problem
now and that is that as soon as I enter my 'custom' control the tooltip is
displayed inmediatly :-(

I use the MouseMove event of my custom control to get the location of the
mouse and using that to figure out where the mouse is and what the tooltip
has to display. So in the MouseMove event I set the tooltip using the
SetToolTip function.

I've set the AutoPopDelay to 5000 (5sec) and the InitialDelay and
ReshowDelay to 1000 (1sec). But still the tooltip is display as soon as I
enter the control with the mouse (no 1sec delay :-( ). This is probably
because the SetToolTip function is called as soon as I enter the control
because of the MouseMove event?

If I use the MouseHover event then the tooltip is only displayed once when
the mouse is inside the control...

Do you or someone else have a solution for this?
Thanks in advance!

With regards,
Tinus

"James Westgate" <ja***********@nospam.nospam> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl...
You can use a single tooltip control and just display it depending on the
location of your cursor, using the Tooltip class. Use the SetTooltip
method to assciate the text with the control. Destroy and recreate the
object everytime your tooltip changes.

James
--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw function in C#). Basically it draws 31 boxes and writes the day
number in every box.

This works great. But I now want to show a different tooltip for every
day. For now I found out that I can add a tooltip for the entire custom
control but how to create a tooltip for every box that I've drawn in my
custom control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus


Nov 17 '05 #13

P: n/a
HI,

Do you create a new tooltip object everytime the mouse enters a new calendar
day? The tooltip control considers your control as one "region" so will
start counting the delay immedialtely.

James
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in message
news:e1**************@TK2MSFTNGP09.phx.gbl...
James,

I did what you recommended and it works.... however I have a small problem
now and that is that as soon as I enter my 'custom' control the tooltip is
displayed inmediatly :-(

I use the MouseMove event of my custom control to get the location of the
mouse and using that to figure out where the mouse is and what the tooltip
has to display. So in the MouseMove event I set the tooltip using the
SetToolTip function.

I've set the AutoPopDelay to 5000 (5sec) and the InitialDelay and
ReshowDelay to 1000 (1sec). But still the tooltip is display as soon as I
enter the control with the mouse (no 1sec delay :-( ). This is probably
because the SetToolTip function is called as soon as I enter the control
because of the MouseMove event?

If I use the MouseHover event then the tooltip is only displayed once when
the mouse is inside the control...

Do you or someone else have a solution for this?
Thanks in advance!

With regards,
Tinus

"James Westgate" <ja***********@nospam.nospam> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl...
You can use a single tooltip control and just display it depending on the
location of your cursor, using the Tooltip class. Use the SetTooltip
method to assciate the text with the control. Destroy and recreate the
object everytime your tooltip changes.

James
--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw function in C#). Basically it draws 31 boxes and writes the day
number in every box.

This works great. But I now want to show a different tooltip for every
day. For now I found out that I can add a tooltip for the entire custom
control but how to create a tooltip for every box that I've drawn in my
custom control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus



Nov 17 '05 #14

P: n/a
Ehhmm,

The ToolTip object is created once (in the InitializeComponent function) and
the SetToolTip is called everytime the MouseMove event is triggert. In the
MouseMove event I calculate the position of the mouse relative to the drawn
schedule and set the ToolTip accordingly.

Do you think I need to create a new ToolTip every time the mouse is over a
new day using the MouseMove event (by disposing of it and recreate it by
using 'new ToolTip()' )? And I can do this only by using the MouseMove
event (only way of knowing where the mouse is on the control)...

I'm still learing c# so maybe that's way I don't fully know how to implement
your suggestion :-(

This is what I've got so far. In the MouseMove event I calculate using the
mouse position coordinates where the mouse is (in which day box of the
schedule). Occording to that I set the ToolTip to the day on which the mouse
is. This works perfectly. As soon as I enter the 'custom' control on a day
the tooltip is shown inmediately with the day number in it (no hover delay!!
even when the predelay is set). When I don't move the mouse it dissapears
after the preset 5sec. However, as soon as I move it, it is shown again,
again no delay. If I move to a different day box the tooltip is inmediatly
changed to the new text (day number) without dissapearing...

Hopefully you understand my problem and know what I'm doing wrong...

Thanks for your help and time.

Regards,
Tinus
"James Westgate" <ja***********@nospam.nospam> wrote in message
news:eo**************@TK2MSFTNGP10.phx.gbl...
HI,

Do you create a new tooltip object everytime the mouse enters a new
calendar day? The tooltip control considers your control as one "region"
so will start counting the delay immedialtely.

James
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:e1**************@TK2MSFTNGP09.phx.gbl...
James,

I did what you recommended and it works.... however I have a small
problem now and that is that as soon as I enter my 'custom' control the
tooltip is displayed inmediatly :-(

I use the MouseMove event of my custom control to get the location of the
mouse and using that to figure out where the mouse is and what the
tooltip has to display. So in the MouseMove event I set the tooltip using
the SetToolTip function.

I've set the AutoPopDelay to 5000 (5sec) and the InitialDelay and
ReshowDelay to 1000 (1sec). But still the tooltip is display as soon as I
enter the control with the mouse (no 1sec delay :-( ). This is probably
because the SetToolTip function is called as soon as I enter the control
because of the MouseMove event?

If I use the MouseHover event then the tooltip is only displayed once
when the mouse is inside the control...

Do you or someone else have a solution for this?
Thanks in advance!

With regards,
Tinus

"James Westgate" <ja***********@nospam.nospam> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl...
You can use a single tooltip control and just display it depending on
the location of your cursor, using the Tooltip class. Use the SetTooltip
method to assciate the text with the control. Destroy and recreate the
object everytime your tooltip changes.

James
--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw function in C#). Basically it draws 31 boxes and writes the day
number in every box.

This works great. But I now want to show a different tooltip for every
day. For now I found out that I can add a tooltip for the entire custom
control but how to create a tooltip for every box that I've drawn in my
custom control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus



Nov 17 '05 #15

P: n/a
James,

Thanks man! It worked! In the MouseMove event I calculate the position and
look if the mouse has not left a certain daybox.... if it has, I destroy the
ToolTip object and recreate one and set the ToolTip text.... now the ToolTip
appearse after a certain time and not inmediatle anymore :-)

Thanks again for your help!
Tinus
- The Netherlands -

"James Westgate" <ja***********@nospam.nospam> wrote in message
news:eo**************@TK2MSFTNGP10.phx.gbl...
HI,

Do you create a new tooltip object everytime the mouse enters a new
calendar day? The tooltip control considers your control as one "region"
so will start counting the delay immedialtely.

James
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:e1**************@TK2MSFTNGP09.phx.gbl...
James,

I did what you recommended and it works.... however I have a small
problem now and that is that as soon as I enter my 'custom' control the
tooltip is displayed inmediatly :-(

I use the MouseMove event of my custom control to get the location of the
mouse and using that to figure out where the mouse is and what the
tooltip has to display. So in the MouseMove event I set the tooltip using
the SetToolTip function.

I've set the AutoPopDelay to 5000 (5sec) and the InitialDelay and
ReshowDelay to 1000 (1sec). But still the tooltip is display as soon as I
enter the control with the mouse (no 1sec delay :-( ). This is probably
because the SetToolTip function is called as soon as I enter the control
because of the MouseMove event?

If I use the MouseHover event then the tooltip is only displayed once
when the mouse is inside the control...

Do you or someone else have a solution for this?
Thanks in advance!

With regards,
Tinus

"James Westgate" <ja***********@nospam.nospam> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl...
You can use a single tooltip control and just display it depending on
the location of your cursor, using the Tooltip class. Use the SetTooltip
method to assciate the text with the control. Destroy and recreate the
object everytime your tooltip changes.

James
--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uD**************@TK2MSFTNGP12.phx.gbl...
Hello all,

[Sorry for x-posting but did not know in which group someone could help
me]

I've created a custom control that draws a monthly schedule (using the
Draw function in C#). Basically it draws 31 boxes and writes the day
number in every box.

This works great. But I now want to show a different tooltip for every
day. For now I found out that I can add a tooltip for the entire custom
control but how to create a tooltip for every box that I've drawn in my
custom control??

Hope someone can shed a light on this problem for me!

Thanks in advance;
Regards,
Tinus



Nov 17 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.