Solved

How do I format the RichTextBox two combine two fontStyle (example Bold and Italic) in VB.Net 2003?

Posted on 2006-07-14
2
676 Views
Last Modified: 2012-08-14
How do I format the RichTextBox two combine two fontStyle (example Bold and Italic) in VB.Net?

From research I belive in C# you can do the following but I do the following;

richTextBox1.SelectionFont =  new Font( "Tahoma", 10, System.Drawing.FontStyle.Bold |System.Drawing.FontStyle.Italic)

I have tried the following but it did not seem to work.

RichTextBox_Content.SelectionFont = New Font("Tahoma", 8, System.Drawing.FontStyle.Bold And System.Drawing.FontStyle.Italic)

Thanks in Advance

Matthew
0
Comment
Question by:mj_stanton
2 Comments
 
LVL 34

Accepted Solution

by:
Sancler earned 500 total points
ID: 17113751
RichTextBox_Content.SelectionFont = New Font("Tahoma", 8, System.Drawing.FontStyle.Bold And System.Drawing.FontStyle.Italic)

should be

RichTextBox_Content.SelectionFont = New Font("Tahoma", 8, System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic)

That is, the And should be Or

Roger
0
 

Author Comment

by:mj_stanton
ID: 17113885
Excellent, Thanks again Roger worked well
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question