Maintaining Form Control

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

Ivan Weiss

Hi Guys. I am starting a "corporate toolbox" to maintain projects for a
company. I need the main form to be controllable so I can disable it as
I step through the application. When a user brings up another form I
want to disable the main form and/or hide it. I have pondered over this
for awhile, what is the best way to create a main form that you can
control?

I was thinking of creating a splash screen and use that as the main form
which than call the "real main form" and make it shared so other forms
can access its functions.

Any other ideas?

Thanks,

-Ivan
 
* Ivan Weiss said:
Hi Guys. I am starting a "corporate toolbox" to maintain projects for a
company. I need the main form to be controllable so I can disable it as
I step through the application. When a user brings up another form I
want to disable the main form and/or hide it. I have pondered over this
for awhile, what is the best way to create a main form that you can
control?

You can show the form modally over the main form by calling its
'ShowDialog' method. Maybe it's better to develop an MDI environment.
I was thinking of creating a splash screen and use that as the main form
which than call the "real main form" and make it shared so other forms
can access its functions.

What's your exact problem/question? How to _implement_ the idea you
describe above or to find a better approach?
 
My goal is to create the easiest yet efficient way to manage the forms I
create. Unfortunately I liked VB6 better in this regard. I am
currently doing the following which seems to work but hopefully wont
backfire later:

In a module I created a global variable:

Public objMain As frmMain

in the frmMain class Form_Load event I have:

objMain = Me

in any other forms I am creating I am inserting the following code:

objMain.Enabled = True
objMain.Activate()

above:

MyBase.Dispose(disposing)

in the:

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

method. Is this an acceptable approach or should I be doing something
else. Whenever I create a new instance of another form I simply set
enabled = false to the main form.

I am actually re-writing a similar program and want it to function
basically the same but with more features (for ease of use). If there
is a better method I am open to suggestions. I do not think MDI is the
better option for this type of application, although is that generally
preferred?

-Ivan
 
Back
Top