1 Attachment(s)
VB.NET Form AutoScale Problem
Hi All... I am just struggling here with a form and getting a "universal" layout when using on several computers/screens. I think I have read so many things on this that I am totally lost on what the rule should be when creating a form that should look the way I want on almost any computer. The attached picture is what I am dealing with on a real simple form. The top section is of course how I want it to look, the bottom section is how it looks on a couple other computer screens. Both computers running WIN10, but monitors are of different size. I have made some changes to DPI, FONT etc. Made my Font sizes the same, but I just cant seem to get it right. Any suggestions?
Re: VB.NET Form AutoScale Problem
I’d use a tablelayoutpanel, with dock = fill (whole form). Add columns and rows to your TLP, then use anchoring or docking in the TLP cells to align your controls in a uniform layout. That’s my best advice. Think yourself lucky you’re not trying to layout controls with Java Swing :D l
Re: VB.NET Form AutoScale Problem
Thanks paul... I have not used a TLP before. So this on Form_Load?
Code:
Me.TableLayoutPanel1.Dock = DockStyle.Fill
So the idea is to have one control in one TLP cell?
Re: VB.NET Form AutoScale Problem
On a side note, people with these kinds of needs should really look into learning WPF. WPF handles this sort of thing very naturally.
Re: VB.NET Form AutoScale Problem
Quote:
Originally Posted by
mikeg71
Thanks paul... I have not used a TLP before. So this on Form_Load?
Code:
Me.TableLayoutPanel1.Dock = DockStyle.Fill
So the idea is to have one control in one TLP cell?
You can add containers to cells within a TableLayoutPanel(TLP) to give more flexibility, even another TLP.
1 Attachment(s)
Re: VB.NET Form AutoScale Problem
Thanks for all of the thoughts and ideas on this, I am just now playing around with it. Not sure why, but here is what it looks like at runtime. You can see my TLP cell height, but it expands the labels much higher. I have the labels docked to the bottom. What seems to cause me some trouble is the group-boxes they don't stay in really good alignment with my textboxes.
**Edit: I left out "Me.TableLayoutPanel1.Dock = DockStyle.Fill" on Form_Load and it looks ok now. Still a long way to go for understanding all of the controls.
Re: VB.NET Form AutoScale Problem
Hi All... I have a project with listbox drag & drop. Do I need to reference the TableLayoutPanel at all when I use it?