They're both used to grow/shrink the control, to fill up to empty space as designed. The form might have different dimensions on another PC, due to resolution, size of the screen and the amount of pixels per inch.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
After experimenting with the Anchor property, I have most of the form looking alright after making changes. I don't think the Dock property is going to work for this project. It seems like the labels will need to be manipulated at runtime.
The top screenshot is how I want it to look across any of the default Windows DPI settings if that is possible.
This is how the Anchor property is configured for each of the controls.
Image upper left - Anchor = Top, Left
Title label upper right - Anchor = Top, Right
Enter Credentials label - Anchor = Top, Left
First Name label - Anchor = Top, Left
First Name textbox - Anchor = Top, Right
Last Name label - Anchor = Top, Left
Last Name textbox - Anchor = Top, Right
Username label - Anchor = Top, Left
Username textbox - Anchor = Top, Right
Abort button - Anchor = Bottom, Right
Backup button - Anchor = Bottom, Right
Any other suggestions as to how to make this work properly?
I'm thinking at this point that I should get the current DPI setting and if it's greater than 96 dpi then move the x-coordinate of the labels.
The title "File Archiver Utility" is in a label. The label itself wraps tightly around the text and the text-align property is set to MiddleCenter and AutoSize is set to True. I might be able to get away with making a banner that includes the logo and title because the image seems to scale or just move the label to the left at launch. I have a couple of other labels that are to the right as well so moving them at launch is probably the best approach.
I made the label the full width from the right edge of the logo graphic to the right edge of the window. Although the text isn't aligned proportionally the same as when DPI is 100%, I would say it falls into the "good enough" category. I'm going to try changing the X location to see how that works.
I could probably put the left edge of the label to where I want the text to be aligned when DPI is 125% and then change the alignment of the box to LeftCenter.
Suppose I have following code. (not necessarily in one function or even one class.)
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap("[path]");
How can I detect if bmp was disposed or not? it is not set to null when calling Dispose, but trying to check a property (ef width and height) to see if it is a valid property immediately results in an exception being thrown.
I searched google, but found not real satisfactory option. I try to set bmp = null where I can after dispose, but this is not always and option. (for one thing, this application is a heritage of someone else )