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
678 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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