如何为 ListviewItem 设置工具提示 [英] How to set tooltip for a ListviewItem

查看:31
本文介绍了如何为 ListviewItem 设置工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是带有几个固定大小列的 ListView.

I am using a ListView with a few fixed-size columns.

行中的文本可能太大而无法放入列中,因此我希望当用户将鼠标悬停在 ListViewItem 上时,它会显示带有更多文本的工具提示.

The text in the rows may be too large to fit in the column, so I would like to make it so that when the user hovers over the ListViewItem, it shows a tooltip with more text.

我尝试设置 ListViewItemToolTipText 属性:

I tried setting the ToolTipText property of the ListViewItem:

ListViewItem iListView = new ListViewItem("add");

iListView.ToolTipText = "Add Expanded";
myListView.Items.Add(iListView);

不幸的是,它似乎不起作用.如何让 ListViewItems 显示工具提示?

Unfortunately, it didn't seem to work. How can I get ListViewItems to show ToolTips?

推荐答案

将 ListView 的 ShowItemToolTips 属性设置为 true.

Set the ListView's ShowItemToolTips property to true.

这篇关于如何为 ListviewItem 设置工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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