Solved

how can i deactivate forms in background?

Posted on 2006-11-22
12
258 Views
Last Modified: 2010-04-23
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?



0
Comment
Question by:x1877
  • 4
  • 2
  • 2
  • +2
12 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
You can set the Enabled() property for all the backgrounds forms to False.

What version VB.Net are you working with?

And are you working with MDI forms, or stand-alone forms?
0
 
LVL 1

Expert Comment

by:kulkarnivishwajit
Comment Utility
Hi,

You can use the Form.Deactivate event to solve your problem.

Regards,
kulkarnivishwajit
0
 

Author Comment

by:x1877
Comment Utility
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
0
 
LVL 1

Expert Comment

by:kulkarnivishwajit
Comment Utility
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
0
 

Author Comment

by:x1877
Comment Utility
i need it in vb.net
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 24

Expert Comment

by:Jeff Certain
Comment Utility
kulkarnivishwajit,

runat=server means you're running a web app... I believe the poster is writing a Windows Forms application.
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
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?
0
 
LVL 34

Accepted Solution

by:
Sancler earned 500 total points
Comment Utility
I don't think you need to write your own code to "deactivate" forms in the background.  If you make your login form modal - call it with ShowDialog - then that should remian on top and be the only form that reacts to any user input whilst it is open.

Roger
0
 

Author Comment

by:x1877
Comment Utility
hi Idle_Mind ,

can i get the code for wt you are saying?
0
 

Author Comment

by:x1877
Comment Utility
Idle_Mind.. i am waiting
0
 
LVL 34

Expert Comment

by:Sancler
Comment Utility
Have you actually tried my suggestion - calling your login form with ShowDialog?

Roger
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now