Hello helpers !
I try to improve a VB .Net software by using a switch between normal/maximized window.
As triggering a scale on Controls is easy and done,
I am stuck when changing from Form1 to Form2 and "keeping current" the windowState ( 0:normal, or 2:maximized ).
It's a logical problem ( hard time this one ) and maybe a mischoice about 'event'.
I have lot of try already , using windowState , using a token about the current form, few events.
About event , which one will be the more relevant to fire this operation on a Form ?
I try with events : Layout / resize / shown... there is always one fork failing
I miss something but can not find the good one.
Thanks in advance !
I try to improve a VB .Net software by using a switch between normal/maximized window.
As triggering a scale on Controls is easy and done,
I am stuck when changing from Form1 to Form2 and "keeping current" the windowState ( 0:normal, or 2:maximized ).
It's a logical problem ( hard time this one ) and maybe a mischoice about 'event'.
Code:
Public Sub set_form_scaling()
'del is the current and active Form
If del.WindowState = 0 Then ' normal window
apply_resizing({(1215 / Screen.PrimaryScreen.Bounds.Width), (690 / Screen.PrimaryScreen.Bounds.Height), 12}) ' shrink apply
End If
If del.WindowState = 2 Then ' maximized window
apply_resizing({(Screen.PrimaryScreen.Bounds.Width / 1215), (Screen.PrimaryScreen.Bounds.Height / 690), 18}) ' grow apply
End If
If del.WindowState = 1 Then ' minimized window
' no action
End If
End Sub
I have lot of try already , using windowState , using a token about the current form, few events.
About event , which one will be the more relevant to fire this operation on a Form ?
I try with events : Layout / resize / shown... there is always one fork failing
I miss something but can not find the good one.
Thanks in advance !