CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    8

    Resizing a RichTextBox

    Hi

    I have placed a richtextbox on a form and I would like its size to be the size of the form, so I set the dock property to fill. My problem is that when I added a menubar and a toolbar at the top of the form, the first few lines of the rtb are now hidden. On the other hand if I set the dock property to none, when I resize the form, the rtb size remains fixed.

    Is there a way to make the rtb start exactly under the toolbar but when I resize the form it will be resized accordingly?

    Thank you in advance.

  2. #2
    Join Date
    Oct 2004
    Location
    Rocket City
    Posts
    220

    Re: Resizing a RichTextBox

    One way would be to remove the richtextbox and then add it again so that you are adding it AFTER the menubar and toolbar have already been added and docked.

    If you don't want to risk removing the richtextbox (maybe you added a lot of properties already) you could risk hacking the form1.Designer.cs file. Find the area (near the bottom) where there are a group of statements like 'this.Controls.Add(...'.
    Try reversing the order of those statements.

  3. #3
    Join Date
    Sep 2011
    Posts
    8

    Re: Resizing a RichTextBox

    Thank you, I will try that out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured