-
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
-
Have you tried the Anchor property? try setting it to hold postion for bottom...or something like that..havent used it yet.
-
Yes, I have tried setting achor to bottom. Arrg, it has to be something simple I am just overlooking.
-
Try selecting the RTB and "bringing to front" - (or sending to back)
-
Yes but if i do this would i just then be covering the status bar instead of the text area?
-
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...
-
Thanks Bananafish, that works great!!
If i ever catch a bananafish, I will let it go from now on!