TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Muralidharan Renganathan
NA
3
0
Setting Tooltips only for longer text width WPF COMBO
Apr 16 2015 5:58 AM
Hi,
I am creating a WPF application. My application has a WPF combo box in which i am embedding a Text block in it.
I am filling some items to the combo. My question is i want the combo box to display full text for the text whom length is smaller than the combo width, and for the longer widths i need to display the text followed by dots.
I am able to fill in the contents to the combo and also able to set the tooltip.
My question is i want to enable the tooltip only for longer texts and NOT for shorter texts. How to add the conditional check ?
Code
for (int count = 0; count < 100; count++)
{
TextBlock textBlock = new TextBlock
{
Text = count
Width = combobox.Width - 30,
};
textBlock.ToolTip = textBlock.Text;
combobox.Items.Add(textBlock);
}
Reply
Answers (
1
)
How to close all opened windows form in Wpf application.
'System.Windows.Documents.Hyper' is not a Visual or Visual3D