Parent Form Loose Focus While SubForm Focus?

Posted on 2006-06-07
Last Modified: 2008-02-01
Yes, I've tried many methods, but nothing seems to work very well.

I have a registration SubForm that opens via a simple class.cs......not directly by the main form

I would like to "Freeze" the main form completely until the registration form is accepted.

I don't want the registration form minimized or anything other kind of sneaky work-around.

Just completely lock-up the main parent form..........

I tried this method in the class.cs

Registration reg = new Registration();
                            reg.TopMost = true;

And used this in combination on the registration form_load

this.TopMost = true;

Question by:kvnsdr
    LVL 85

    Accepted Solution

    I don't see what the problem is...

    If you show your Registration form using ShowDialog() then the main form will not be accessible until the Registration form is closed.

    Set the ControlBox() property of your Registration form to False.  Provide a Button to Accept the entries.  When it is clicked, Hide the form (which cancels the ShowDialog() call from the main form).  If something is missing on the form then pop up a MessageBox and don't hide the form...
    LVL 1

    Author Comment

    Must have been a glich in VS, it's working now........

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    760 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

    15 Experts available now in Live!

    Get 1:1 Help Now