System Model

Ok. On the Form_Load Event, I have a messagebox pop-up. I think the correct term is System Model. I am not sure. But what I would like is for the user not to be able to do anything..and I mean anything, on the computer..until she/he presses the ok button on the messagebox. Can someone tell me how to do this


Answer this question

System Model

  • Ramon A. Paulino

    Like this: ( put this in your Form_Load event )

    if(MessageBox.Show(this, "Press ok to continue", "Press ok", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.OK)
    {
        // continue form loading
    }
    else
    {
       // user pressed cancel
    }

    Some explainations. A messagebox returns a value about what button the user has pressed, or in other terms the dialog result. So when the user pressed OK it return a DialogResult.OK and otherwise DialogResult.Cancel.

    Another thing is, that when u do this in the GUI thread ( the form's thread) the program will wait for the input of the MessageBox, as it is a Dialog. So the form will not load further before the user has pressed a button.

    Good luck!



  • Sreepada

    That is not what im looking for. What I want is, when the message box pops up, for the user NOT to be able to do ANYTHING on the computer until she/he presses ok. This includes selecting items on the desktop, ect.

  • System Model