I have a TextBox
that's in a FlowLayoutPanel
that's inside a cell of a TableLayoutPanel
. The FlowLayoutPanel
spans 5 columns of the TableLayoutPanel
and fills up the entire width of the 5 columns. However, the TextBox
doesn't fill up the entire width of the FlowLayoutPanel
, as you can see here (the black border is the FlowLayoutPanel
):
How can I get the TextBox
to span the entire width of the FlowLayoutPanel
?
Code to produce this example:
// fsi --exec Test.fsx
open System
open System.Windows.Forms
let frmMain () =
let f = new Form(Text = "Test table layout panel")
let tlp =
new TableLayoutPanel
( ColumnCount = 5,
RowCount = 1,
AutoSize = true,
Parent = f )
let flp =
new FlowLayoutPanel
( AutoSize = true,
BorderStyle = BorderStyle.FixedSingle )
let tb = new TextBox(Parent = flp)
tlp.Controls.Add(flp, 0, 0)
tlp.SetColumnSpan(flp, 5)
flp.Dock <- DockStyle.Fill
tb.Dock <- DockStyle.Fill
f
[<STAThread>]
do
Application.EnableVisualStyles()
Application.Run(frmMain ())
TextBox
height and width to theFlowLayoutPanel
's height and width? I'm not into F# but by based on the code snippet theTextBox
height and width should set exclusively. – LightlyPanel
instead of aFlowLayoutPanel
and setting theDock
toFill
does solve the problem. Thanks! – AstronomicalPanel
is the right control for this job. – Astronomical