You can also add a new parameter to your application (size) and set it to system.drawing.size
Then you should save the current size in the settings when closing.
Private Sub myForm_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles MyBase.FormClosing My.Settings.size = Me.Size My.Settings.Save() End Sub
and at boot you apply the size that you saved in the settings
Private Sub myForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles MyBase.Load ' if this is the first time to load the form ' dont set the size ( the form will load with the size in the designe) If Not My.Settings.size.IsEmpty Then Me.Size = My.Settings.size End If End Sub
Waleed el-safty
source share