CheckBox Alignment Problem


Author
Message
Aaron Young
Aaron Young
StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Hi,

I don't know if this problem is theme related but take a look at the three attached screenshots.

CheckBox1 shows four checkboxes in the forms designer. All are aligned perfectly and the captions show correctly.

CheckBox2 shows the form running with the checkbox AutoSize property set to false. Three of the checkboxes lose the last character of the caption and there is a noticeable gap between the 'E' and 'd' in 'Editable' in the last caption.

CheckBox3 shows the form running with the checkbox AutoSize property set to true. All captions show correctly and the gap between the 'E' and 'd' has disappeared. However, the position of the boxes have been pushed to the right to break the alignment.

If AutoSize is set to true, the box is on the right and the control needs to make an adjustment, could any change in the size be reflected with a change in the left start position to keep the box in the same position on the right? That way the boxes would remain in alignment.

Thanks,

Aaron

Attachments
CheckBox1.png (109 views, 7.00 KB)
CheckBox2.png (113 views, 5.00 KB)
CheckBox3.png (109 views, 5.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
No...this is .NET related...irritating isn't it Smile

Our checkbox doesn't actually follow themes as there was no real reason that it needed to.  In the future we will create a check box that doesn't inherit from the System.Windows.Forms.Checkbox.  But this problem actually started with .NET 2.0.  This isn't exclusive to a checkbox, but rather a label as well.  The way that the controls render within the designer is slightly different (smaller usually) than when rendered at run-time. 

A couple of tips on this.  First, never let the Checkbox or labels autosize...this will buy you a lot.  Secondly, always give yourself an extra 5-8 pixels buffer when placing them in close quarters to account for a slightly larger font render at run-time.  This should prevent this from happening.

Aaron Young
Aaron Young
StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)StrataFrame User (435 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Yes, it is irritating. Thanks for the tips. I will need to watch out for labels as well.

Thanks

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search