473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

rich text box string - easy way to bold and italicize?

Ok, I am creating a string to go into a RTB. Is there any code or tags I can create within the string so that I can Bolden or Italicize certain words?



I would normally assume no way until I saw that VStudio automatically changes my URL addresses into real links. Sure would be nice to be able to tag certain words as bold or italics.....



ANY easy way to do this?



My sample code is below:



monthlyRetirementString = "For an annual desired salary of : " + retireAnnualAmountTB.Text + "\r\n\r\n" +

"You will need a nestegg of approx. : " + nestEgg.ToString() + "\r\n" +

"-----------------------------------------------------" + "\r\n" +

"\r\n With a starting age of : " + retireDropDown.SelectedItem.ToString() +

"================================================= ==== \r\n" +

"You will need a monthly investment of : " + monthlyAmountNeeded.ToString() +

"\r\n\r\n *these figures are assuming a 12% return on your investment minus 4% inflation</i>";




retireDetailsRTB.Text = monthlyRetirementString;





======

** I would like to be able to BOLD the Final monthly investment part and to italicize the last part about the assumptions.
Aug 7 '07 #1
3 2009
Plater
7,872 Expert 4TB
If you use a RichTextBox you can use the SelectionColor or SelectionFont (there are a bunch of them)
You can use those to change the text style as you add text to your RichTextBox.

If you want it all done before hand, build it up like I suggested until you have it looking the way you want. Then take a look at the .Rtf string to see all the special character codes you need to insert into your string.
Then in the future you would set the .Rtf property instead of the .Text property
Aug 7 '07 #2
I am sorry but I am not following your .RTF string. Where do I find that?
Aug 9 '07 #3
Plater
7,872 Expert 4TB
I am sorry but I am not following your .RTF string. Where do I find that?
It's a property of RichTextBoxes
Aug 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo...
4
by: Dru | last post by:
Hi, I am making a textarea for people to add/modify their text for descriptions products. I want to have buttons (or just text links) with functions that will allow them to bold, italicize, sup,...
1
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
4
by: Arpan | last post by:
How do I format only the Header text (column names) in a DataGrid? Consider the following code snippet: <asp:DataGrid id="myDataGrid" GridLines="both" AutoGenerateColumns="false" runat="server">...
9
by: Jason | last post by:
If I've got Me.RichTextBox1.Text = "In Ricn Tex Box" Me.RichTextBox1.Text &= "Line two" & vbCrLf How do I make the first line appear BOLD?
5
by: GY2 | last post by:
I want to step through the rows returned by my DataView, extract some values from some of its columns and append them as separate lines to the text of various rich textbox controls while possibly...
1
by: pooba53 | last post by:
I have a rich textbox control and a long string of characters that I will assign to it's .text property. How can I bold some characters and apply italics to others?
2
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, Sorry for the long-winded dissertation - but, I have an application where I need to write text to a rich text box using a common method, callable from anywhere in my application. The...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.