Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Guys,

I am using visual studio 2008.

I have several buttons in my UI grouped with group-boxes

now it seems impossible to vertically align these group-boxes.

if I shift it to left or right, it always jumps with 2 pixels (grid snap is off)
even when I do manually in the resources, changing the position definition with 1 pixel, the result is a shift with 2 pixels...

I also tried a snap line, f.e. at 146 the border of the group box is on the snap line
when I place the snap line at 147 (this is the position I whish), the border of the group box is at 148. when the snap line is at 148 the border is also at 148.


how can I change this?
It is really annoying! I want my UI to look nice and aligned, no spaghetti layout

Thanks

PS It seems the problem is related to the font size I select in my dialog,
when I take an other font, all my group boxes get messed up!?
Posted
Updated 7-Nov-12 2:39am
v4

1 solution

A dialog is layed out using dialog units, not pixels.
Dialog units are based on the font.

Here is a KB about calculating dialog units.
http://support.microsoft.com/kb/145994/EN-US[^]
 
Share this answer
 
Comments
Blob_Dlg 7-Nov-12 9:11am    
I see, the recourse editor is in DLUs

But still, at the position I want (147 DLU), I can not align my group box
__John_ 7-Nov-12 9:17am    
Using the resource editor can be a bit tricky when trying to position controls exactly. You could try setting the position programaticaly when the dialog opens.
Blob_Dlg 9-Nov-12 5:03am    
Did that.

Not really a "user friendly" resource editor...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900