views:

158

answers:

2

EDIT > SOLVED: It turns out that I had set all of the UI elements' font properties to be 14pt Arial, but not the usercontrol itself, so when it was drawing it on the form, it was resizing it all. Changing the usercontrol's font size to 14pt Arial, and then repositioning/resizing everything fixed it.

I started working on the UI for an app I'm making. The app has a devexpress tab control, and initially I was just placing all of my controls in there to see what it'd look like and to work out any layout issues. Well, I decide to pull out all of the ui elements for each tabpage and toss them into a UserControl and to have that UserControl fill the tab page.

The problem is that it looks perfectly normal (ie. the same as before) when in the usercontrol but when I bring that over to the tab page, all of the ui elements are HUGE (about double in size, but not exactly double).

Here's some images to show you what I mean.

Edit> Note: This is a winforms app.

UserControl:

edit > images removed

Form:

edit > images removed

It turns out that the objects are being resized. I checked the .Size property of the ui elements after the usercontrol.load event and they are much larger than they are supposed to be. This happens if there is the anchoring as I'd like it, all top-left anchored and no anchoring at all.

+1  A: 

Hard to say without seeing code...

[edit]

Well if you have no code then I only have one idea. The controls inside your user control have anchors that are being adjusted to the size of the parent control. The parent control could be larger than expected making all the anchors adjust with the parent. This would then make them all appear too big. This is my only idea...

[/edit]

Bobby Cannon
Right now there is no code. So far, all I've done is drag/drop ui elements onto my forms/usercontrols and changed their properties in the designer.
SnOrfus
as per your edit. That's a good idea that I didn't think of. Will check that out to be sure.
SnOrfus
+1 for anchor/dock settings
Jeff Yates
unfortunately, no dice.
SnOrfus
A: 

The AutoScaleMode of the UserControl should be at "None"...