New form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PiotrKolodziej

    New form

    Hi.
    I have a window app. After clicking a button i need to display another
    window ( Options window ) in such a way that "getting back" to previous one
    is blocked, unless "OK" is pressed.
    How to do this?

    Thanks PK

    --

    Pozdrawiam
    Piotr Kolodziej



  • Stuart Irving

    #2
    Re: New form

    Use .ShowDialog instead of .Show
    "PiotrKolodziej " <piotr.kolodzie j@gmail.com> wrote in message
    news:e45e9$4419 9dcc$57cf80bf$1 2298@news.chell o.pl...[color=blue]
    > Hi.
    > I have a window app. After clicking a button i need to display another
    > window ( Options window ) in such a way that "getting back" to previous
    > one is blocked, unless "OK" is pressed.
    > How to do this?
    >
    > Thanks PK
    >
    > --
    >
    > Pozdrawiam
    > Piotr Kolodziej
    > http://piotrkolodziej.waikru.info
    >[/color]


    Comment

    • PiotrKolodziej

      #3
      Re: New form

      Thanks


      Comment

      • Stoitcho Goutsev \(100\)

        #4
        Re: New form

        Piotr,

        Keep in mind that when closing a form shown via ShowDialog the form is
        hidden rather than closed and disposed.
        That's why it is good idea to dispose such forms if you don't intend to
        reuse it.

        The easiest way is to show the dialog in *using* statement

        using(MyDialogF orm dlg = new MyDialogForm())
        {
        // initialize the dialog
        if(dlg.ShowDila og() == DialogResult.Ok )
        {
        //consume the data
        }

        }



        --
        HTH
        Stoitcho Goutsev (100)

        "PiotrKolodziej " <piotr.kolodzie j@gmail.com> wrote in message
        news:22ab8$4419 a5f9$57cf80bf$1 3684@news.chell o.pl...[color=blue]
        > Thanks
        >[/color]


        Comment

        Working...