Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2008

Tip: Looking for answers? Try searching our database.

Different color text in textbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tshad - 13 Feb 2008 19:21 GMT
Can you have different color text is a standard TextBox?

I know you can in a RichText box but what about the TextBox.

Same with bolding - can you bold one line of text in the text box and then
unbold the next line?

Thanks,

Tom
Serge Wautier - 13 Feb 2008 20:07 GMT
You're asking for rich text in a non richtext box !
The answer is no, richtext is available from richtext box only ;-)

HTH,

Serge.
http://www.apptranslator.com - Localization tool for your applications

> Can you have different color text is a standard TextBox?
>
[quoted text clipped - 6 lines]
>
> Tom
Herfried K. Wagner [MVP] - 13 Feb 2008 22:24 GMT
"tshad" <tshad@dslextreme.com> schrieb:
> Can you have different color text is a standard TextBox?
>
> I know you can in a RichText box but what about the TextBox.
>
> Same with bolding - can you bold one line of text in the text box and then
> unbold the next line?

No, the Windows Forms textbox control doesn't support that (except in WPF).

Signature

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

Ravi Bhavnani - 17 Feb 2008 17:32 GMT
Contrary to the other replies, yes you can.

 myTextBox.ForeColor = ...

Bolding is an other issue.  :(

Hope this helps,

/ravi

-----------
> Can you have different color text is a standard TextBox?
>
[quoted text clipped - 6 lines]
>
> Tom
Herfried K. Wagner [MVP] - 17 Feb 2008 18:22 GMT
"Ravi Bhavnani" <ravib@ravib.com> schrieb:
> Contrary to the other replies, yes you can.
>
>  myTextBox.ForeColor = ...
>
> Bolding is an other issue.  :(

Re-read the OP's post.  You cannot change the color of a certain line in the
textbox.

The font can be changed by assigning a new font to the control's 'Font'
property.  Specify 'FontStyle.Bold' to use a bold font.

Signature

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


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.