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

Custom Control and ToolTips?

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
15 10903
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christian H | last post by:
Hi! I've created a custom control (myDrawControl) that deals with drawing. This control is then added to a form( myMainForm) Now, whenever something is dragged and dropped onto myDrawControl ,...
0
by: Tinus | last post by:
Hello all, 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...
1
by: Wannabe_Geek | last post by:
Hi Iam new to MS .Net technology just getting along with it....I created a custom control ,which takes in a query and displays the data in a tabular format....something similar to a datagrid. ...
2
by: J R M | last post by:
I've developed a custom control (it's basically a drop-down list and then a couple of textboxes to include meta-data for the selection) that I'm embedding into another custom control (the idea is...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
11
by: Nick Gilbert | last post by:
Hi, How can I create a custom control which will wrap its content in a header and footer? eg: Is it possible to create a .NET user control which can surround other controls? eg:...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.