Global Form Settings

  • Thread starter Thread starter Ivan Weiss
  • Start date Start date
I

Ivan Weiss

Does anyone know of a way to globally set form options like borderstyle,
windows position etc.

I want some of the same settings to be application wide for every form
and selecting all of them individually is a pain especially if I want to
change one option throughtout the application.

Thanks,

-Ivan
 
There's no easy way to do this in the IDE, but you can do this
programmatically,

Two methods:
1. Create a StandardForm class that inherits
fromSystem.Windows.Forms.Form, and all your other forms inherit from the
StandardForm.
In the Standard form's constructor set the properties you want to
standardize.


2. Create a method in the project that will set a forms size, location
etc. properties and call this method in each form's load event

Class Form1

Private sub Form1_Load.....

SetStandardFormValues(Me)

End sub
End Class

Private Sub SetStandardFormValues(ByRef TheForm As Form)
TheForm.Size = New System.Drawing.Size(200, 200)
TheForm.Text = "Changed"
End Sub
--------------------
 
Back
Top