| | |
about Font
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2009
Posts: 9
Reputation:
Solved Threads: 0
private void ToolStripButtonBold_CheckedChanged(object sender, EventArgs e)
{
Font oldFont;
Font newFont;
bool checkState = ((ToolStripButton)sender).Checked;
//Get the font that is being used in the selected text.
oldFont = this.richTextBoxText.SelectionFont;
if (!checkState)
newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Bold); else
newFont = new Font(oldFont, oldFont.Style | FontStyle.Bold);
//Insert the new font and return focus to the RichTextBox
this.richTextBoxText.SelectionFont = newFont;
this.richTextBoxText.Focus();
this.ToolStripMenuItemBold.CheckedChanged -= new EventHandler(ToolStripMenuItemBold_CheckedChanged);
this.ToolStripMenuItemBold.Checked = checkState;
this.ToolStripMenuItemBold.CheckedChanged += new EventHandler(ToolStripMenuItemBold_CheckedChanged);
}
this one -newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Bold); i can't understand ,please tell me ,thank you
{
Font oldFont;
Font newFont;
bool checkState = ((ToolStripButton)sender).Checked;
//Get the font that is being used in the selected text.
oldFont = this.richTextBoxText.SelectionFont;
if (!checkState)
newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Bold); else
newFont = new Font(oldFont, oldFont.Style | FontStyle.Bold);
//Insert the new font and return focus to the RichTextBox
this.richTextBoxText.SelectionFont = newFont;
this.richTextBoxText.Focus();
this.ToolStripMenuItemBold.CheckedChanged -= new EventHandler(ToolStripMenuItemBold_CheckedChanged);
this.ToolStripMenuItemBold.Checked = checkState;
this.ToolStripMenuItemBold.CheckedChanged += new EventHandler(ToolStripMenuItemBold_CheckedChanged);
}
this one -newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Bold); i can't understand ,please tell me ,thank you
![]() |
Similar Threads
- Possible Font Book problem? (OS X)
- Mozilla and Font Sizes (*nix Software)
- SuSE 9.0 Professional showing crappy font face/type (*nix Software)
- ie font problems (Web Browsers)
Other Threads in the C# Forum
- Previous Thread: Populating Textbox from another textbox using DB fields
- Next Thread: Trouble with Bitmap border
Views: 585 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access algorithm array barchart bitmap box button buttons c# chat check checkbox class client code color combobox control conversion csharp custom database datagridview dataset datetime degrees draganddrop drawing encryption enum excel file files form format forms ftp function gcd gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






