473,569 Members | 2,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Font to bold, italic, underline only

Okay,

Assinging the font and its style (bold, italic etc.) using the font dialog
is easy such as:
FontDialog1.Sho wDialog()

txtEmailBody.Se lectionFont = FontDialog1.Fon t

But how does one change the selected text to bold, italic or underlined
without using the font dialog?

I've looked under .selectionfont and.selectedtex t and can't see any way to
change it to bold, italic etc. All I see is a read-only property that tells
me if its bold, italic etc.

There's go to be a way. All these apps have these small B, I, U buttons.

Initialize a font, tweak it and assign it? Is that really the only way?

Thanks,

Adam


May 7 '06 #1
2 2856
"Adam Honek" <Ad*******@Webm aster2001.frees erve.co.uk> schrieb:
Assinging the font and its style (bold, italic etc.) using the font dialog
is easy such as:
FontDialog1.Sho wDialog()

txtEmailBody.Se lectionFont = FontDialog1.Fon t

But how does one change the selected text to bold, italic or underlined
without using the font dialog?

I've looked under .selectionfont and.selectedtex t and can't see any way to
change it to bold, italic etc. All I see is a read-only property that
tells me if its bold, italic etc.


Removing a certain font style:

\\\
EmailBody.Selec tionFont = _
New Font( _
EmailBody.Selec tionFont, _
EmailBody.Selec tionFont.Style And Not FontStyle.Bold _
)
///

Adding a font style: '... = New Font(..., EmailBody.Selec tionFont Or
FontStyle.Bold) '.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 7 '06 #2
Thanks, it worked and could equally do underline, italic the same way.
Thanks.

Adam

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:O0******** ******@TK2MSFTN GP03.phx.gbl...
"Adam Honek" <Ad*******@Webm aster2001.frees erve.co.uk> schrieb:
Assinging the font and its style (bold, italic etc.) using the font
dialog is easy such as:
FontDialog1.Sho wDialog()

txtEmailBody.Se lectionFont = FontDialog1.Fon t

But how does one change the selected text to bold, italic or underlined
without using the font dialog?

I've looked under .selectionfont and.selectedtex t and can't see any way
to change it to bold, italic etc. All I see is a read-only property that
tells me if its bold, italic etc.


Removing a certain font style:

\\\
EmailBody.Selec tionFont = _
New Font( _
EmailBody.Selec tionFont, _
EmailBody.Selec tionFont.Style And Not FontStyle.Bold _
)
///

Adding a font style: '... = New Font(..., EmailBody.Selec tionFont Or
FontStyle.Bold) '.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2643
by: Viken Karaguesian | last post by:
Hello all, It stinks being a newbie! One thing that I'm not sure about with CSS is: where is the "proper" place to put font attibutes? This has me a little confused. Take the below style sheet (which is a work in progress) as an example. If I don't put the font attributes in the <body> <p> and <td> tags, the font will not appear the way I...
7
1682
by: Derrick | last post by:
Can anyone tell me how to persist and retrieve the font characteristics that a user chooses to have displayed in a personalized label field on the front of their application? I wanted to be able to give the user this ability so that they could place a company logo, motto, or simply a message of the day on the form, and have it redisplay from...
0
1267
by: silverprox | last post by:
Hi, I'm developing a simple composite control with 2 child controls, a Label and a TextBox. I expose easily many properties of the inner controls, in the form i.e.: BoxToolTip & LabelToolTip, BoxForeColor & LabelForeColor, BoxCssClass & labelCssClass... but when I try to insert the BoxFont & LabelFont properties,
1
1137
by: shachar | last post by:
hi all. i have a grid ocx i'm using, and i have to set it's font to an integer value returning from a font object. when i wrote : Dim f As System.Drawing.Font al it's propertys are readonly. how can i set it's Bold,Underline etc..
7
2941
by: Sakharam Phapale | last post by:
Hi All, How to preserve the old font properties while changing new one? I posted same question 2 months back, but I had very small time then. eg. "Shopping for" is a text in RichTextBox and already formatted as "Shopping" ---Bold "for" -----Regular Now I want to underline whole text by preserving old style i.e. Bold and
1
1688
by: Gidi | last post by:
Hi, Is it possible to draw string with few font styls, like in WORD (i.e. Bold and Underline) at the same line, on the same text ? and is it possible that part of the line will be bold and the other one not ? Thanks, Gidi.
0
1385
by: the.tinapatel | last post by:
Guys, I want the user to be able to select font (such as Bold, Italic, underline) and stuff like that from a dropdown list) and then I wanna apply these properties to all my page (all text). Now I'm doing something like this: string font = string.Empty; switch(ddl2.SelectedItem.Text) {
1
8628
by: FLEMEF | last post by:
Hello All, I'm not very good at Java... With this piece of Java code, how could I modify the StyleOptions.java program to allow the user to specify the size of the font, while using the text field to obtain the user’s input. Thanks. ----------------------------------------------------------------- import javax.swing.*; import...
0
7938
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8145
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7694
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5245
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2128
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1236
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.