ToolTip,而不是ToolTip? [英] ToolTip, not ToolTip ?

查看:84
本文介绍了ToolTip,而不是ToolTip?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

当您浏览网页时,您经常会遇到一个类似于工具提示的文本框。通常这个文本内部是暗淡的,你把光标放在窗口,文本消失。它可能会说一句话:"你的电子邮件",
或已将您的邮政编码作为提示。

Very often when you browse the web you run into a textBox with something that appears like a ToolTip inside. Frequently this text inside is kind of dimmed, you put a cursor in the window and the text disappears. It may say something line: "Your email," or have already your zip code as a prompt.

我想在我的编码中重现它,但两个工具提示都没有给出类似的效果。我还检查了C#ToolBox中TextBox的所有属性,但找不到任何内容。它可能会以编程方式重现,但我想知道一个特殊的属性。

I want to reproduce it in my coding but both tooltips don't give similar effect. I also checked all properties for the TextBox in C# ToolBox and could not find anything. It can probably reproduced programmatically but I wonder about a special property.

可以在MSVS中完成吗?

Can it be done in MSVS?

谢谢, - MyCatAlex

Thanks, - MyCatAlex

推荐答案

什么都没有在C#语言中,您需要使用诸如WPF或Windows Forms之类的GUI来执行此操作。所以这个问题不应该在C#
语言论坛中。

您可以使用图形绘制文本,如
如何:在Windows窗体
。但该样本具有误导性;看到"你应该覆盖

OnPaint
方法"。这使它更复杂。请参阅 Windows窗体中的图形和绘图用于
Windows中的图形描述;我相信你不想阅读所有内容,但它与Windows中大多数图形的使用相关。

You can probably draw the text using graphics, as in How to: Draw Text on a Windows Form. However that sample is misleading; see the part that says "you should override the OnPaint method". That makes it more complicated. See Graphics and Drawing in Windows Forms for a description of graphics in Windows; I am sure you don't want to have to read all of that but it is relevant to most all uses of graphics in Windows.

如果你使用的是WPF而不是Windows Forms,那么你应该说的。

If you are using WPF and not Windows Forms then you should have said that.


这篇关于ToolTip,而不是ToolTip?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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