C# - 点击标签 [英] C# - making a click through label

查看:59
本文介绍了C# - 点击标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在标签位于按钮顶部时单击按钮,其原因是使得像通知号码一样,就像你在这些应用程序图标上的ios中一样,但这是一个按钮和一个标签。



例如我只需将标签拖到一个按钮上即可。但是我不希望标签只重复按下按钮的动作。



因此标签可能会妨碍用户使用他们按下按钮,我希望标签有点像按钮的一部分,所以当按下标签时它没有,没有做任何事情。



所以我是想知道这是否可能,如果是的话,请告诉我有关它的信息。

谢谢



PS - 请不要留下评论/答案,比如,你是一个乞丐程序员而且你很糟糕,并且不要甚至谈论这个问题,它只是粗鲁。

I was wondering if it is possible to click a button while a label is ontop of a button, the reason for it is to make like a notification number just like you get in an ios on those application icons, but this is with a button and a label.

for example I simply just drag a label over a button. But I don''t want the label to just repeat the actions of the button that had been pressed.

so the label could be in the way of the user when they press the button, I want the label to kinda be apart of the button so then when the label is pressed it dose not, not do anything.

so I was wondering if this is possible, and if so, please give me information on it.
thank you

P.S - please don''t leave comments/answers like, you are a begginer programmer and you suck, and don''t even talk about the question, its just rude.

推荐答案

在WPF中,可以使用ControlTemplates直接在按钮上添加标签:

stackoverflow.com [ ^ ]

MSDN [ ^ ]

wpftutorial.net [ ^ ] <无线电通信/>




IDK关于winforms的解决方案,但你可能不得不使用工具提示......
In WPF there is a possibility to add a label directly on a button by using ControlTemplates:
stackoverflow.com[^]
MSDN[^]
wpftutorial.net[^]


IDK about a solution for winforms but you may have to use a tool tip...


您是否尝试添加工具提示?为此:只需从表单上的工具箱中拖动工具提示项。选择您的按钮,然后在toolTip1 属性的工具提示中添加文本。这是当您将鼠标悬停在按钮上时将看到的文本。
Have you tried to add a tooltip? To do this: Just drag a ToolTip item from your toolbox on your form. The select your button, and add a text in the ToolTip on toolTip1 property. This is the text you will see when you hover with your mouse over the button.


这篇关于C# - 点击标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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