0

My project contains 2 Forms, one is the LoginForm, other is the MainForm The LoginForm will do this when login button is clicked and assume it is a successful login:

MainForm mainForm = new MainForm ();
this.Hide();
mainForm.ShowDialog();
this.Show();

This is my login form when I run the program (it is correct):

Image1

when I login, this is the MainForm:

Image2

it shrink, it should look like this:

Image3

then I hit the log out button from MainForm (it execute this.close()), the login form reappear, but now it is look like this:

Image4

way smaller and not even in the center of the desktop as I set them to be in properties. But somehow, my friend who ran the program on a 12.5 inch laptop (1366 x 768 resolution), all the things is perfectly fine, mine is 14 inch (1920 x 1080) get the above problems. The IconButton from FontAwesome cause this, it's all good after I remove all IconButton from the forms

Jimi
  • 29,621
  • 8
  • 43
  • 61
tr44nv
  • 3
  • 3
  • Read the notes here: [DPI Awareness - Unaware in one Release, System Aware in the Other](https://stackoverflow.com/a/50276714/7444103) and also take a look at the marked duplicate. Since you're probably targeting .Net Framework, read this: [High DPI support in Windows Forms](https://learn.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms) -- You should always specify the .Net version in use. – Jimi May 09 '22 at 16:29
  • I do what the links says but it is still shrinking – tr44nv May 10 '22 at 16:03
  • I have no idea what you have done. Add the information to the question. – Jimi May 10 '22 at 16:05

0 Answers0