自定义控件和工具提示? [英] Custom Control and ToolTips?

查看:74
本文介绍了自定义控件和工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


[很抱歉x-post但不知道哪个小组有人可以帮助我]


我'已经创建了一个自定义控件,用于绘制每月计划(使用C#中的Draw

函数)。基本上它绘制了31个盒子并在每个盒子里写下了每天的价格。


这很好用。但我现在想要每天都展示一个不同的工具提示。

现在我发现我可以为整个自定义控件添加工具提示

但是如何创建一个我在自定义中绘制的每个盒子的工具提示

控制?


希望有人可以为我解决这个问题!


提前致谢;

问候,

Tinus

解决方案




一些可能性;

1)你可能已经测试了这个,但是你不能;不要画框,

从控件中动态创建每个框。然后,您可以为每个框设置分隔的

工具提示。在我看来,如果你没有表现

问题每一天应该是一个班级,最好用

a用户/自定义控制来描述。

2)从标签或其他东西制作您自己的自定义工具提示控件

在计算的位置显示它。定时器控制应该足够了一段时间后显示/隐藏它。$ / b
)作为一个想法;构建一个不可见的用户/自定义控件并分配你的

工具提示。如果指针在一个框上方重新定位在鼠标指针下方,它将显示工具提示。 (你可以限制绘制区域变成

一个看不见的控件)


祝你好运,

Adnan

Tinus < no **************** @ xxx.karssemeijer.com.noadv.xxx>写在消息

新闻:uD ************** @ TK2MSFTNGP12.phx.gbl ...

大家好,


[很抱歉x-post但不知道哪个组有人可以帮助我]


我已经创建了一个自定义控件来绘制每月安排(使用C#中的Draw

函数)。基本上它绘制了31个盒子并在每个盒子里写下了每天的价格。


这很好用。但我现在想要每天都展示一个不同的工具提示。

现在我发现我可以为整个自定义控件添加工具提示

但是如何创建一个我在自定义中绘制的每个盒子的工具提示

控制?


希望有人可以为我解决这个问题!


提前致谢;

问候,

Tinus


< blockquote>


一些可能性;

1)你可能已经测试了这个,但是你不能;不要画框,

从控件中动态创建每个框。然后,您可以为每个框设置分隔的

工具提示。在我看来,如果你没有表现

问题每一天应该是一个班级,最好用

a用户/自定义控制来描述。

2)从标签或其他东西制作您自己的自定义工具提示控件

在计算的位置显示它。定时器控制应该足够了一段时间后显示/隐藏它。$ / b
)作为一个想法;构建一个不可见的用户/自定义控件并分配你的

工具提示。如果指针在一个框上方重新定位在鼠标指针下方,它将显示工具提示。 (你可以限制绘制区域变成

一个看不见的控件)


祝你好运,

Adnan

Tinus < no **************** @ xxx.karssemeijer.com.noadv.xxx>写在消息

新闻:uD ************** @ TK2MSFTNGP12.phx.gbl ...

大家好,


[很抱歉x-post但不知道哪个组有人可以帮助我]


我已经创建了一个自定义控件来绘制每月安排(使用C#中的Draw

函数)。基本上它绘制了31个盒子并在每个盒子里写下了每天的价格。


这很好用。但我现在想要每天都展示一个不同的工具提示。

现在我发现我可以为整个自定义控件添加工具提示

但是如何创建一个我在自定义中绘制的每个盒子的工具提示

控制?


希望有人可以为我解决这个问题!


提前致谢;

问候,

Tinus


< blockquote> Adnan,


感谢您的帮助....

1)嗯,这意味着我必须重新创建整个控件(而且我' 'm

到目前为止:-()

2)你能更具体地说明如何做到这一点吗?我试图创建一个没有边框的新表格

并使用MouseHover(和MouseMove)事件显示它。

的问题是当我显示表格时它有焦点而且无法回到

我的控制.....

3)是一种肮脏可行的方式,但我不喜欢它。


我还在学习C#所以忍受我: - )


再次感谢!

Tinus


" adnan boz" < AB ********* @ hotmail.com>在消息中写道

news:u3 ************** @ TK2MSFTNGP10.phx.gbl ...


一些可能性;
1)你可能已经测试了这个,但是你不能;不要画框,
从控件中动态创建每个框。然后,您可以为每个框设置分离的工具提示。在我看来,如果你没有性能问题每一天应该是一个班级,最好用
用户/自定义控件描述

2)从标签或其他东西制作您自己的自定义工具提示控件,并在计算的位置显示它。定时器控制应足以在一段时间后显示/隐藏它。
3)作为一个想法;构建一个不可见的用户/自定义控件并分配您的
工具提示。如果指针在框上方重新定位在鼠标指针下方,它将显示工具提示。 (你可以限制绘制区域成为一个看不见的控件)

好运,
Adnan

" Tinus" < no **************** @ xxx.karssemeijer.com.noadv.xxx>写在
消息
新闻:uD ************** @ TK2MSFTNGP12.phx.gbl ...
大家好,

[抱歉x发布,但不知道有哪些人可以帮助我/

我已经创建了一个自定义控件,可以按月计划(使用
在C#中绘制
函数。基本上它绘制了31个盒子并在每个盒子中写下了日期编号。

这很好用。但我现在想为每一天展示一个不同的工具提示。
现在我发现我可以为整个自定义控件添加工具提示
但是如何为每个盒子创建一个工具提示我已经在我的自定义
控件中绘制了?

希望有人能为我解决这个问题!

提前致谢; Tinus



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

解决方案

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


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


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



这篇关于自定义控件和工具提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆