Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple questions by new user

Status
Not open for further replies.

dazzer

Technical User
Apr 7, 2002
4
GB

Ok.. I'm getting confused by what is probably simple stuff but I need to ask someone before I go mad. They are all RTF related questions !!

1) How do you enable an RTF to be multiline but disable the wordwrap. ie Your VB editor does exactly this.

2) How do you make the scrollbars appear even when the text has not flooded so they dont actually need to do anything. ie Your VB editor does this. Mine appear when required and MSDN says that they should appear regardless.

3) DisableNoScroll. This is supposed to disable the scrollbars, but they simple appear initially disabled and when the text floods a boundry, they re-enable themselves.

I'll stop there, even though I have many more questions. I've searched MSDN for answers and ended up even more confused. One last one though... How do I make highlighted text greyscale. ie Your VB editor does this !!

Thanks for reading my rant and sorry if these are simple questions, I did try to find the answers myself, honest !!

Regards

Dazzer
 
Hello

1) You need to set the 'RightMargin' property to a value greater than the width of the RichTextBox i.e. RichTextBox1.RightMargin = RichTextBox1.Width * 3
This would give you a typing width of three times the visible width of the control

2) Set the following
RichTextBox1.DisableNoScroll = True
RichTextBox1.ScrollBars = rtfBoth
(You cannot do this at runtime)

3)Set the following
RichTextBox1.DisableNoScroll = False
RichTextBox1.ScrollBars = rtfNone

Not sure what you mean on your last point.


Hope this helps
 
Thanks for answering.. I was getting lonely :)

With regards to point 1, I have since found out that VB5 RTF has a bug that if the right margin is 0 then it never wraps. I've just upped from VB5 to VB6 and MS fixed it.. Doh ! Thats why I was confused.

My last question that you didnt understand I'll rephrase. Sorry, guess it wasnt that clear really.

If you select (ready to copy for a paste), some text within your VB editor, it will color the background light grey and the text will turn black regardless of the text's original color. ie A comment that is green or a keyword that is blue always turns black when drag-selected in the editor. An RTF uses invert to show you what text you have selected. Which means that the selected text is multi-colored if the original text was multi-colored. It looks horrible and I was wondering how to change it. Having said that, I have downloaded over 40 code snippits from various sites regarding the RTF and no-one else has changed it either. Maybe it looks fine and it's just me that has bad taste, eh ?? :)

Regards

Dazzer


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top