|
-
Sep 7th, 2010, 01:23 PM
#1
Thread Starter
Addicted Member
[RESOLVED] TableLayoutPanel problem
Ok, it's the first time I try to use this control, and I can't figure this out.
Problems:
1. How to get 0 padding/inner margin in the cells? I want just the border as a colored line at the next close pixel to the control in the cell. Or if border set to none, I want the controls with no gap.
2. How do I actually add/remove rows& columns? I thought this was by setting the .ColumnCount property, but if I set it to 3, and then try to access the third column, it gives exception, so it's obviously just two columns, although it also looks like 3 on the form. ? I created it in designer with 2 columns though. But I don't understand how this hangs together..
plz.. ?
http://i54.tinypic.com/2nitpo4.png
Code:
Dim z0, z1, z2 As New ZedGraphControl
z0.Dock = DockStyle.Fill
z1.Dock = DockStyle.Fill
z2.Dock = DockStyle.Fill
z0.Padding = New Padding(0)
z1.Padding = New Padding(0)
z2.Padding = New Padding(0)
tlpTest.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single
tlpTest.AutoSize = True
tlpTest.Padding = New Padding(0)
tlpTest.Margin = New Padding(0)
tlpTest.ColumnCount = 1
tlpTest.Controls.Add(z0, 0, 0)
tlpTest.ColumnCount = 2
tlpTest.Controls.Add(z1, 1, 0)
tlpTest.ColumnCount = 3
tlpTest.Controls.Add(z2, 2, 0)
tlpTest.ColumnStyles.Item(0).SizeType = SizeType.Percent
tlpTest.ColumnStyles.Item(0).Width = 33
tlpTest.ColumnStyles.Item(1).SizeType = SizeType.Percent
tlpTest.ColumnStyles.Item(1).Width = 33
'tlpTest.ColumnStyles.Item(2).SizeType = SizeType.Percent
'tlpTest.ColumnStyles.Item(2).Width = 33
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|