0

I set WindowState to Maximized in From1 properties but when I run the project, the icon in the taskbar disappear. If I set it to Normal the icon appear normally. I tried to set the windowState to normal and then during form load setting it to maximized but without success.

Private Sub index_Load(sender As Object, e As EventArgs) Handles Me.Load

    Btn_home.Visible = False

    Me.WindowState = FormWindowState.Maximized


    Panel1.Controls.Add(_menù)
    currentPanel = _menù
    'Me.ShowInTaskbar = True
End Sub

If I move Me.WindowState = FormWindowState.Maximized after currentPanel = _menù is showing normally but I don't know why and also I have to get the size of the form maximized in the panel _menù.

  • This code belongs in the constructor, add Public Sub New. Explanation [is here](http://stackoverflow.com/a/4934010/17034). – Hans Passant Mar 22 '17 at 11:18
  • But inside my menù panel I have to get the parent width and height to center some buttons. Do you have some advice? I really appreciate your help, thanks! – GiacomoG Mar 23 '17 at 09:26

0 Answers0