Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Remove/Disable Underline Property of a Text Block
2 replies. Latest Post by okaravian on June 28, 2008.
(1)
okaravian
Member
113 points
81 Posts
06-27-2008 11:53 AM |
<p><div>
//following is my code to set and unset the bold italic and underline properties of a text block
private void btnBold_MouseLeftButtonDown(object sender, RoutedEventArgs e) { if (currentText.FontWeight == FontWeights.Bold) { currentText.FontWeight = FontWeights.Normal; } else { currentText.FontWeight = FontWeights.Bold; } } private void btnItalic_MouseLeftButtonDown(object sender, RoutedEventArgs e) { if (currentText.FontStyle == FontStyles.Italic) { currentText.FontStyle = FontStyles.Normal; } else { currentText.FontStyle = FontStyles.Italic; } } private void btnUnderline_MouseLeftButtonDown(object sender, RoutedEventArgs e) { if (currentText.TextDecorations == TextDecorations.Underline) { ????????????????????????????????????????????????? } else { currentText.TextDecorations=TextDecorations.Underline; } }
What can I write code to disable only the underline property of a textblock when textblock may have bold and italic and underline property at same time.
anybody help me out thanks in advance.
</dv>
</p>
lee_sl
Contributor
2990 points
584 Posts
06-27-2008 12:04 PM |
currentText.TextDecorations = null;
06-28-2008 2:23 AM |
<div>
Thank you dear It is working fine
</div>