I'm trying to add TextBoxes in a square 'array' into a GroupBox. It
looks like I have to, for each TextBox, get the size of the GroupBox,
calculate position of each TextBox, set the Location of the TextBox to a
new Location object with the calculated coordinates and the TextBox
should then be located in the correct position. I'd much rather say, for
example, left gap equals x%, top gap = y%, draw the TextBox, dimensions
a% by b%, move right z%, draw the next TextBox and so on.
What I'm aiming for is a square of TextBoxes which form a playing grid,
much like a chessboard.
I guess the answer to the question is "I wouldn't do it that way, and I
suggest you do it this way...." sort of thing.
Any help would be appreciated.
Cheers,
Cliff

Signature
Have you ever noticed that if something is advertised as 'amusing' or
'hilarious', it usually isn't?
Bram - 17 Jul 2007 12:52 GMT
Hi Enkidu,
The control you are looking for is the TableLayoutPanel. This .NET 2.0
control allows you to do exactly what you want to do.
Cheers,
Bram
> I'm trying to add TextBoxes in a square 'array' into a GroupBox. It
> looks like I have to, for each TextBox, get the size of the GroupBox,
[quoted text clipped - 20 lines]
> Have you ever noticed that if something is advertised as 'amusing' or
> 'hilarious', it usually isn't?
Peter Duniho - 17 Jul 2007 19:03 GMT
> The control you are looking for is the TableLayoutPanel. This .NET 2.0
> control allows you to do exactly what you want to do.
Alternatively, depending on the exact behavior desired, the
FlowLayoutPanel may be preferable.
In either case, just put the panel inside the GroupBox, then add your
TextBox instances to the ...LayoutPanel programmatically as necessary.
Pete
Enkidu - 18 Jul 2007 09:52 GMT
>> The control you are looking for is the TableLayoutPanel. This .NET 2.0
>> control allows you to do exactly what you want to do.
[quoted text clipped - 4 lines]
> In either case, just put the panel inside the GroupBox, then add your
> TextBox instances to the ...LayoutPanel programmatically as necessary.
Thanks guys!
Cheers,
Cliff

Signature
Have you ever noticed that if something is advertised as 'amusing' or
'hilarious', it usually isn't?