|
-
Feb 16th, 2005, 12:26 AM
#1
Thread Starter
Member
Bold Italic and Underlined
In my Wordpad application,I have 3 buttons doing the font functions Bold, Italic and Underlined.
All 3 buttons are Push Buttons.
I have done the following,
If all 3 buttons are clicked:
Richtextbox1.Font=New Font(Combobox1.Text,Combobox2.Text,Font.StyleBold AND Font.StyleItalic AND Font.StyleUnderlined)
But the code doesnt seem to work.
-
Feb 16th, 2005, 12:55 AM
#2
Re: Bold Italic and Underlined
 Originally Posted by cybertechno
In my Wordpad application,I have 3 buttons doing the font functions Bold, Italic and Underlined.
All 3 buttons are Push Buttons.
I have done the following,
If all 3 buttons are clicked:
Richtextbox1.Font=New Font(Combobox1.Text,Combobox2.Text,Font.StyleBold AND Font.StyleItalic AND Font.StyleUnderlined)
But the code doesnt seem to work.
use OR instead of AND?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 16th, 2005, 10:25 AM
#3
Re: Bold Italic and Underlined
Hi,
I'm not sure you need to bother with such things. After all, presumably each button will function independently of the others so that you could set Bold or Italic or Underline on their own. An easier way to do it would thus be to have a general "Font flag" to which clicking on Bold adds 1, Italic adds 2 and Underline adds 4 (I think these are the numbers, but you can look them up in the Help), and conversely subtracts if you click off the push button. Then you can always just use the value of "Font Flag" in the [style] part of the argument.
Does that make sense?
HTH
zaza
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|