x1877
asked on
how can i deactivate forms in background?
i have an application which has a feature like screen saver. After a specific time, I want to show the login form and all other form in background should be deactivated. I am able to bring the login form, but the background forms are not getting deactivated, how can I do this?
Hi,
You can use the Form.Deactivate event to solve your problem.
Regards,
kulkarnivishwajit
You can use the Form.Deactivate event to solve your problem.
Regards,
kulkarnivishwajit
ASKER
hi Idle_Mind , i am working with stand alone forms , vb.net 2003, can u give me code examples?
kulkarnivishwajit, sorry could not find deactivate method
kulkarnivishwajit, sorry could not find deactivate method
Hi,
Have you tried this?
A page with three <form> tags marked runat="server" is allowed, but only one form's Visible property can be set to true. By playing with the Visible property of the HtmlForm class, you can change the active server form during the page's lifetime.
Regards,
kulkarnivishwajit
Have you tried this?
A page with three <form> tags marked runat="server" is allowed, but only one form's Visible property can be set to true. By playing with the Visible property of the HtmlForm class, you can change the active server form during the page's lifetime.
Regards,
kulkarnivishwajit
ASKER
i need it in vb.net
kulkarnivishwajit,
runat=server means you're running a web app... I believe the poster is writing a Windows Forms application.
runat=server means you're running a web app... I believe the poster is writing a Windows Forms application.
Unfortunately VB.Net 2003 does not have a Forms collection like VB.Net 2005 (or the old VB6).
So you have to manually track all the open forms yourself in a collection (like the ArrayList) that you can iterate over to disable all the forms.
This will require you to either update the collection whenever a form is opened/closed or make them all Inherit from a base form that does this for you.
If you have a limited set of forms that will only be open one at a time then you can make global variables and then hard code in disabling/enabling them.
At any rate, it would require much change to your application. Is this still something you want to do?
So you have to manually track all the open forms yourself in a collection (like the ArrayList) that you can iterate over to disable all the forms.
This will require you to either update the collection whenever a form is opened/closed or make them all Inherit from a base form that does this for you.
If you have a limited set of forms that will only be open one at a time then you can make global variables and then hard code in disabling/enabling them.
At any rate, it would require much change to your application. Is this still something you want to do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi Idle_Mind ,
can i get the code for wt you are saying?
can i get the code for wt you are saying?
ASKER
Idle_Mind.. i am waiting
Have you actually tried my suggestion - calling your login form with ShowDialog?
Roger
Roger
What version VB.Net are you working with?
And are you working with MDI forms, or stand-alone forms?