last day (14 days later) » 

1:40 PM
1
A: Make a GUI neater programatically?

TaWControls come with a default Margin of (3, 3, 3, 3). In addition to the zero Padding of the FLP you should set the Controls' Margins to zero or values you like: switch (child.Name) { case "textbox": String txtlabel = child.Attributes["label"].Value; TextBoxControl txtctrl = n...

 
I set the Margin to 0;0;0;0 in every individual control that is created.
 
TaW
Meaning what? Does it help? (There is no such setting in the code you have posted..)
 
I thought I mentioned it..? Either way, the individual controls have their Margin set to 0;0;0;0 (in their own code, which is not posted) so I didn't have to do that when I generated the GUI.
 
TaW
No, I didn't understand that. could you post at least one of the classes? what type do they have? UserControl? FLP? I suspect that one of the containers still does have a positive Margin set!
 
Sure, I'll post one of them. The class extends UserControl yes. The Margin is set through the property editor in Visual Studio. :)
 
TaW
1:40 PM
OK, there is no Margin set in that code either. You wrote that you set in in the property editor, so it is in the Desgner.cs. But: do set the Margins for for all parts? That is for the UC and the (presumably) embedded Controls? Your image shows a space of four pixels, which is not the default margin of 3 or 2x3 pixels.. A short no frills test shows that controls in a flp can easily sit along each other without any space.
 
Hm. You might have the point there actually. I put Margin to 0 on the Control and not the buttons, fields and label...that could be it, let me try real quick.
Now I set the Margin to 0 on all components and the gap is still there :/
 
TaW
Hm. How do you set the Height of the UCs? Can you reduce it by 2 pixels? Or are they AutoSize=true?
 
They are AutoSize is false.
 
TaW
Hi!
One way to test such problems is to mialdown the culprit control. If all else fails you could give each UC a different BackColor and look at the color of the pixels in the gap..
 
I figured it out thanks to you :)
I looked how small I could make the controls and now they fit in very tightly
 
TaW
1:48 PM
Good. I'll add a hint to US.Height to my answer then to male it complete..
 
just reword your answer :)
Say that "You need to look at the controls size itself as it ultimately defines how small it can get.
I found that 300;20 is the optimal size
 
TaW
Fine, bye!
PS: Just a thought: setting a fixed height so tightly may run you into trouble with some display resolutions, especially when the windows fonts size is enlarged. It might be better to at least test that and then maybe find a more dynamic solution..
 
I might look into that if the problem arise.
Thanks for the tip :)
 

last day (14 days later) »