How to set a window?

Posted on 2006-04-08
Last Modified: 2011-10-03
I have a windows application, I want to set my form in front of any forms, and set it coundn't be moved or minimized. It just could be show as it initialize.
Question by:ed_dalian
    LVL 7

    Accepted Solution

    like this....

    Form1 fm = new Form1();
    fm.ShowDialog(); //this will keep the focus until the form has closed, also wont let the user do anything else within your app. until Form1 has been closed.

    Form1 properties.
    Change the FormBorderStyle to FixedDialog //this will stop resizing.
    Disable the controlbox. // this will remove min, max, close buttons.

    Hope this helps.
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    On your form:

       Set FormBorderStyle to None.
       Set TopMost to True.
       Set StartPosition to CenterScreen.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    733 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

    23 Experts available now in Live!

    Get 1:1 Help Now