c#中把鼠标悬停到label标签上显示文字怎么实现

来源:百度知道 编辑:UC知道 时间:2024/05/24 09:00:05

winform
添加ToolTip控件
以下语句可以实现
toolTip1.SetToolTip(标签的Id, "显示文字");

asp.net
设置 标签的 ToolTip属性

winform 的话,设置 LABEL 的 TOOLTIP

ASP.NET 的话,指定LABEL 的 title 就可以了
也可以做一个JS脚本来实现

winform 的话,设置 LABEL 的 TOOLTIP

ASP.NET 的话,指定LABEL 的 title 就可以了

右键点击lable 在属性蓝找到 ToolTip 项 填上要显示的 文字内容 即可

<asp:Label ID="lblTest" runat="server" Text="Label" onmouseover="this.innerText='Text'" onmouseout="this.innerText='Label'"></asp:Label>