Results 1 to 7 of 7

Thread: DockStyles

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367

    DockStyles

    Hi All,

    I have a richtextbox and a status bar, and they are causing me some problems, the format is the following...

    --------
    | RTB |
    | |
    ---------
    ---------
    | SB |
    ---------

    I want the RTB to fill, which it does, but I do want to fill only to the status bar, because if it goes more than that, I can not access the horizontal scroll bar. Something like this would be IE. With the status bar below the display area fills up the
    available space upto the status bar. Anyone know of anything??

    Here is my code setting the properties of the two:

    Code:
    statusBar1.Location = new System.Drawing.Point(0, 379);
                statusBar1.BackColor = SystemColors.Control;
                statusBar1.Size = new System.Drawing.Size(512, 20);
                statusBar1.TabIndex = 1;
                statusBar1.ShowPanels = true;
                statusBar1.Text = "statusBar1";
            	statusBar1.Dock = DockStyle.Bottom;
                statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {statusPanel, linePanel});
    
    textArea.Text = "";
                textArea.Size = new System.Drawing.Size(512, 359);
                textArea.TabIndex = 0;
                textArea.Dock = System.Windows.Forms.DockStyle.Fill;
                textArea.WordWrap = false;
                textArea.AcceptsTab = true;
            	textArea.ScrollBars = RichTextBoxScrollBars.Both;
                textArea.TextChanged += new System.EventHandler(this.TextArea_TextChanged);
    Thanks
    Bill

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Have you tried the Anchor property? try setting it to hold postion for bottom...or something like that..havent used it yet.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    Yes, I have tried setting achor to bottom. Arrg, it has to be something simple I am just overlooking.

  4. #4
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    Try selecting the RTB and "bringing to front" - (or sending to back)

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    Yes but if i do this would i just then be covering the status bar instead of the text area?

  6. #6
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    no I don't think so, fill should just fill the remaining space.
    so you could have a toolbar an RTB and a statusbar on the form.

    as long as the status bar and toolbar are behind the rtb, the rtb should only fill the space in the middle.

    Ive just set up a quick test form and it seems to work like that.

    try it and see...

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    Thanks Bananafish, that works great!!

    If i ever catch a bananafish, I will let it go from now on!

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