RichTextBox- Bold Problem 
Author Message
 RichTextBox- Bold Problem

I need to bold every 3rd line starting on the second line on the push of a
command button.

I can't seem to get it to work.

Any help or ideas would be apreciated.

Jason Marcal



Mon, 24 Sep 2001 03:00:00 GMT  
 RichTextBox- Bold Problem
Here is relative info about the textbox control, (Line counts,
word wraping, etc.) wading through it may give you the answer
you are looking for...

http://support.microsoft.com/support/kb/articles/q140/8/86.asp

LFS

Quote:

> I need to bold every 3rd line starting on the second line on the push of a
> command button.

> I can't seem to get it to work.

> Any help or ideas would be apreciated.

> Jason Marcal




Mon, 24 Sep 2001 03:00:00 GMT  
 RichTextBox- Bold Problem

The RichTextBox control is character oriented rather than line oriented. You can find out which line a character is on using the GetLineFromChar method. You can run through the characters until you get to line 2, set SelStart to that position. Count characters from that point until you get to the start of line 3. Set SelLength to that number of characters. Now setting SelBold to True will embolden the 2nd line.

Does that help at all?
--

Simon Jones
MillStream Designs Ltd
Independent IT Consultants

  I need to bold every 3rd line starting on the second line on the push of a
  command button



Tue, 25 Sep 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Inserting Colored or Bold text into a RichTextBox

2. Bold Words in RichTextBox

3. RichTextBox: find a word and make it bold

4. Saving Bold and Italic in RichTextBox

5. Bold Words in RichTextBox

6. RichTextBox Bolding, Italicizing, and Underlining

7. RichTextBox Bold Monospaced Fonts

8. Formatted fields are half bold and half not bold

9. Bold and non-bold text in a label?

10. Echo RichTextBox to RichTextBox

11. Problem displaying a RICH TEXT file in a RichTextBox

12. RichTextBox Control Problem

 

 
Powered by phpBB® Forum Software