Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
Register
Login
1
Reply
Setting Tooltips only for longer text width WPF COMBO
Muralidharan Renganathan
Apr 16 2015 5:58 AM
521
Reply
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);
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How to close all opened windows form in Wpf application.
'System.Windows.Documents.Hyper' is not a Visual or Visual3D