question on multiple font style

steediddydid

New member
Joined
Feb 16, 2006
Messages
2
Programming Experience
Beginner
I'm having trouble getting text in a text box to be bold, italic and underlined when you choose any of them from a menu. Do i have to use if statements to check all possible combinations of the three (bold, italic and underlined). I tried using just the or statements and that didn't work, neither did ctype. If anyone has an example of the code or could help me out that would be great! Thanks.
 
Try this and put it in the Menu Click event,

---------------------------------------------
textbox1.font=new font(textbox1.font.name,textbox1.font.size,textbox1.font.style Xor fontstyle.italic)
---------------------------------

if you want to change it to italic

if you want to change it to bold than change the statement of the "fontstyle.italic" to "fontstyle.bold" the others remains the same

do the same thing if you want to change the the font style to underline
just change it to "fontstyle.underline"
 
Back
Top