A popup form for windows forms app

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harvindersingh
    New Member
    • Sep 2008
    • 24

    A popup form for windows forms app

    Hello guys,

    I am developing a Windows Forms application in C#, I am using PostgreSQL as the Database. The application is bassically using the database to store and lookup information, nothing so fancy about this. The lookup pages are designed to lookup data, and I would like to add a small popup like dialogue which gets invoked if the stated data does not exist in the database. Now I will take care of the event to be invoked, but the only issue I am having is getting a popup window.

    I would like to allow users to add the data if it does not exists in the database, for this I would like a popup to appear in front of them and it should behave similar to a messagebox. Now about the similarities, the only similarity I aould like to have is not allow the user to click on any controls of the form while this popup is open such as when a MessageBox is open you are not able to use the app unless you close the MessageBox with any of the button. I would like to achieve similar abilities for the popup form and once the form is closed, the focus goes back to the app.

    Is this possible to achieve, to be honest my mind tells me that it should be pretty straight forward. However because of my lack of experience with .Net and C# I have not idea about this.

    Thanks in advanced.
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    Create a new form and call it using

    Code:
    Form.ShowDialog()
    The ShowDialog part makes sure that it stays on top and disables the user to click on any control, untill it gets closed.

    Steven

    Comment

    • harvindersingh
      New Member
      • Sep 2008
      • 24

      #3
      Nice this works great thanks!

      Comment

      Working...