I have a Panel docked to the bottom of a form, with the some buttons on the right hand side of the Panel. On Form_Resize, I programmatically set the position of the buttons so that its position on the right is consistent, regardless of the form size.
Now, in the Form_Load event I set the form to FormWindowState.Maximized, and the Form_Resize event is raised. However, at this time, the form is still the size as it is in the designer. Even explicitly calling Form_Resize again after setting it Maximized leaves me with the dimensions of the form in the designer (the form hasn't actually maximized until the Load event has completed).
Because of this, the buttons are in the wrong place on the form. They are not repositioned after the form loads. I can't seem to find an event that fires automatically after Form_Load, and after the form is actually maximized and the new size is accessible.
Or, is there a way in the designer to tell the controls to "stay where they are" in relation to the Panel, regardless of the Form and Panel resizing?
Visual Basic:
btnClose.Left = pnlButtons.Width - btnClose.Width - 10
btnRefresh.Left = pnlButtons.Width - btnRefresh.Width - btnClose.Width - 20
btnUpdate.Left = pnlButtons.Width - btnUpdate.Width - btnRefresh.Width - btnClose.Width - 30
Because of this, the buttons are in the wrong place on the form. They are not repositioned after the form loads. I can't seem to find an event that fires automatically after Form_Load, and after the form is actually maximized and the new size is accessible.
Or, is there a way in the designer to tell the controls to "stay where they are" in relation to the Panel, regardless of the Form and Panel resizing?