Windows Develop Bookmark and Share   
 index > Windows Forms General > Strikeout text
 

Strikeout text

Is it possible to strikout text after the form has gone through its initial load? When i tried to change the property with this line...

button1.Font.Strikeout = true;

I got a compiler error which said...

"Property or indexer 'System.Drawing.Font.Strikeout' cannot be assigned to -- it is read only"

any help would be greatly appreciated

pjzuber  Thursday, June 21, 2007 4:17 PM

You cannot change anything about a font in a control (at any time).

However, you can replace the font.

Code Snippet

Font fnt = new Font(button1.Font, FontStyle.Strikeout);

button1.Font = fnt;

James Curran  Thursday, June 21, 2007 4:40 PM

You cannot change anything about a font in a control (at any time).

However, you can replace the font.

Code Snippet

Font fnt = new Font(button1.Font, FontStyle.Strikeout);

button1.Font = fnt;

James Curran  Thursday, June 21, 2007 4:40 PM

You can use google to search for other answers

Custom Search

More Threads

• Menu Item clicking ?
• problem with inherited custom control
• Hooks
• DateTimePicker Events don't fire
• Where does initializecomponent in a Windows application gets called from?
• Multi Variables in URL
• SaveFileDialog.ShowDialog() crashes in Vista
• How to stop an autoscroll event on a panel?
• listview selection
• Focus bug in tree view