R
RobinS
I have a user control that has this structure from top to bottom:
Label1
Label2
PictureBox1
Label3
PictureBoxes2 through 11
All of the controls are anchored Top,Left. Pictureboxes 2 through 11 are
right next to each other in the designer, with 1 pixel of space between
them.
This user control is added to a form that has this structure:
Form
TopLevelSplitContainer
TopLevelSplitContainer.Panel1
other stuff
TopLevelSplitContainer.Panel2
justAPanel
myUserControl
aDGV
Depending on something happening in the background, it displays the
UserControl or the DGV.
The problem is when I the UserControl is displayed in my form, it spaces out
pictureboxes 2 through 11 and ends up chopping off the right side of the
last picturebox.
I am adding the UserControl programmatically, but even if I just drop it on
the justAPanel in the designer, it does the same thing.
If I don't anchor the controls on MyUserControl at all, they don't spread
correctly vertically, and they are actually wider horizontally than they
would be if I anchored them.
When added programmatically to the form, the usercontrol is set to dock Left
and Top. If I don't dock it, it seems to center it, which chops off both
sides of the usercontrol.
Any ideas why my controls are being rendered differently in run mode than
they are in design mode?
My containing form is a user control, too, by the way, which does sit in an
actual Form that has a minimum size and a default size that this panel
should fit into if it weren't mucking up my picturebox locations.
The reason I have 10 picture boxes is because each one has its own click
event. Just thought I'd throw that in there before someone says "Why don't
you just combine the picture boxes into one?".
Sorry for the cross-posting; I'm desperate.
Thanks in advance.
RobinS.
GoldMail.com
Label1
Label2
PictureBox1
Label3
PictureBoxes2 through 11
All of the controls are anchored Top,Left. Pictureboxes 2 through 11 are
right next to each other in the designer, with 1 pixel of space between
them.
This user control is added to a form that has this structure:
Form
TopLevelSplitContainer
TopLevelSplitContainer.Panel1
other stuff
TopLevelSplitContainer.Panel2
justAPanel
myUserControl
aDGV
Depending on something happening in the background, it displays the
UserControl or the DGV.
The problem is when I the UserControl is displayed in my form, it spaces out
pictureboxes 2 through 11 and ends up chopping off the right side of the
last picturebox.
I am adding the UserControl programmatically, but even if I just drop it on
the justAPanel in the designer, it does the same thing.
If I don't anchor the controls on MyUserControl at all, they don't spread
correctly vertically, and they are actually wider horizontally than they
would be if I anchored them.
When added programmatically to the form, the usercontrol is set to dock Left
and Top. If I don't dock it, it seems to center it, which chops off both
sides of the usercontrol.
Any ideas why my controls are being rendered differently in run mode than
they are in design mode?
My containing form is a user control, too, by the way, which does sit in an
actual Form that has a minimum size and a default size that this panel
should fit into if it weren't mucking up my picturebox locations.
The reason I have 10 picture boxes is because each one has its own click
event. Just thought I'd throw that in there before someone says "Why don't
you just combine the picture boxes into one?".
Sorry for the cross-posting; I'm desperate.
Thanks in advance.
RobinS.
GoldMail.com