RichTextBoxScrollBars

I have downloaded a program called "Reflector" I dont think I should explain that what program does.. because the name says it all :-) but if you want me to I will... anyways... I have a richtextbox in one of my programs (one of my old post has the codes.. but anyways) now.. I am trying to learn how to read the fields that the program has out putted for this function......

public enum RichTextBoxScrollBars
{
// Fields
Both = 3,
ForcedBoth = 0x13,
ForcedHorizontal = 0x11,
ForcedVertical = 0x12,
Horizontal = 1,
None = 0,
Vertical = 2
}

how do I apply that.. to..

txtArea = new RichTextBox();
txtArea.Size = new Size( w - 6, h - 56 );
txtArea.Anchor = ( AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left );
txtArea.Multiline = true;
txtArea.BorderStyle = BorderStyle.Fixed3D;

What I am a bit confused about is.. should I do it like...

txtArea.Vertical = 2





Answer this question

RichTextBoxScrollBars

  • DaftP

    Nice!!! thanx.. So.. in other words.. for me to use the enum I would do it.. the same way you posted correct also.. I dont know if you have used this program.. but.. I am searching for.. Scrollbars in the system.windows.forms.richtextbox and I cant seem to find it.. is this a keywords method

    -------------------------- edited ----------------

    I see ScrollBars is in system.windows.forms.scrollbars;


  • Paul_Rus

    What Im trying to do is make them both visiable.. but.. it sorta looks like the horizontal scrollbar is sorta wordwrapping.


  • retread

    Because RichTextBoxScrollBars is an enum, rather than use the numeric value you can more easily just specify the name and set the ScrollBars property like so:

    txtArea.ScrollBars = RichTextBoxScrollBars.Vertical;

    Is this what you are looking for



  • sigurdr

    Ahh, so from the sounds of it you've got the WordWrap property set to false.

    To display them both instead of setting ScrollBars to RichTextBoxScrollBars.Vertical, set it to RichTextBoxScrollBars.ForcedBoth.



  • RichTextBoxScrollBars