Created
February 2, 2022 08:42
-
-
Save hexbinoct/4bde2e339ccceded197b9b01b27ba35d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in an mdi app, add 2 seperate forms form1 and form2, put a lable in form2, and Anchor it to bottom. start the app, show form1 as max, now show form2, because form1 was max, form2 will also show as max, you will see label in form2 at the correct place. Now, in code, goto the load event of form2, just type label1.Text="hi". Now run the app again, show form1 maximized, and now show form2, it will open maximized, but the anchoring of label will be disturbed, now its not where it was supposed to be, now its distance from top of the form is what it was in the designer. | |
Now if you move the statement label1.Text="hi" from form's Load event to Shown event, the anchoring bug is disappears. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment