I'm developing in C#, and I'm creating a framework with lots of user controls. The problem I've got is that every UserControl I have is being resized (enlarged) when I copy and paste it within the designer. It is a very simple scenario to reproduce (no code samples necessary, as this is reproducible from a blank project with no code added):
Create a new project.
Create a new UserControl1. Set the BorderStyle = FixedSingle (this is just to make things easier to see).
Create a new form. Set the Font on the form to "Tahoma 9pt." Since this is slightly larger than the default font (Ms Sans Serif 8pt), it will cause a small amount of scaling, and that is expected (and desired).
Drag an instance of the UserControl1 onto the form.
Copy and paste the instance of the UserControl1.
The copy will be scaled again, making it larger than the original. Try it, the problem will be obvious to you.
I sort of know why it is happening, but I need to find a way around it, because I can't afford to be re-sizing every control every time I copy and paste it. I know that I can get around this by changing the UserControl's "AutoScaleMode" property to "None," but the problem is that I want the control to be rescaled if the user has their system font-scaling set to greater than 100%. Setting AutoScaleMode to Font provides me with the proper re-sizing in those circumstances, but gives me the unfortunate re-scaling during a copy and paste operation within the designer itself.
Obviously the designer has a way of dealing with this, because built-in controls don't suffer from this problem (try the same experiment with TextBox, and you will see it doesn't get rescaled on a copy and paste).
Anyone have a good approach for dealing with this sort of thing?
Edit: Had originally said "AutoSizeMode" when I really meant "AutoScaleMode." I've corrected this in the the original text.