471,321 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

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.ShowDialog()

txtEmailBody.SelectionFont = FontDialog1.Font

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

I've looked under .selectionfont and.selectedtext 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 2730
"Adam Honek" <Ad*******@Webmaster2001.freeserve.co.uk> schrieb:
Assinging the font and its style (bold, italic etc.) using the font dialog
is easy such as:
FontDialog1.ShowDialog()

txtEmailBody.SelectionFont = FontDialog1.Font

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

I've looked under .selectionfont and.selectedtext 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.SelectionFont = _
New Font( _
EmailBody.SelectionFont, _
EmailBody.SelectionFont.Style And Not FontStyle.Bold _
)
///

Adding a font style: '... = New Font(..., EmailBody.SelectionFont 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**************@TK2MSFTNGP03.phx.gbl...
"Adam Honek" <Ad*******@Webmaster2001.freeserve.co.uk> schrieb:
Assinging the font and its style (bold, italic etc.) using the font
dialog is easy such as:
FontDialog1.ShowDialog()

txtEmailBody.SelectionFont = FontDialog1.Font

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

I've looked under .selectionfont and.selectedtext 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.SelectionFont = _
New Font( _
EmailBody.SelectionFont, _
EmailBody.SelectionFont.Style And Not FontStyle.Bold _
)
///

Adding a font style: '... = New Font(..., EmailBody.SelectionFont 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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Viken Karaguesian | last post: by
7 posts views Thread by Derrick | last post: by
1 post views Thread by Fei Li | last post: by
reply views Thread by silverprox | last post: by
1 post views Thread by shachar | last post: by
1 post views Thread by FLEMEF | last post: by

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.