Change fonts in text box (C#)

Today i will show you how change the Fonts of Notepad
  1. First add a TooStrip
  2. If you can't add toolStrip (if you got error)please right click on tabb and Cut it. Then add the toolStrip and paste the tab again
  3. Then add a button to toolStrip

  4. You can add a image to the button by, right click -> Set Image...
  5. Import a image and press OK
  6. Double click on the button and put this codes
  7.  FontDialog fdb = new FontDialog();
            fdb.ShowColor = true;
                if(fdb.ShowDialog()==DialogResult.OK & !string.IsNullOrEmpty(GetRichBox().Text))
                {
                    GetRichBox().SelectionFont = fdb.Font;
                }
  8. Now run the programm
  9. You can highlight and change the font

  10. Next post I will show you how make Auto complete text box

No comments:

Post a Comment