showdialog login form - login fail, close the app

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    showdialog login form - login fail, close the app

    Hi,
    I have a simple MDIChild login form that loads before the parent, and if the
    user hit's the cancel button on the login form, the whole app should unload.
    How can I do this? Thanks


  • Frank Oquendo

    #2
    Re: showdialog login form - login fail, close the app

    Walter wrote:[color=blue]
    > Hi,
    > I have a simple MDIChild login form that loads before the parent, and
    > if the user hit's the cancel button on the login form, the whole app
    > should unload. How can I do this? Thanks[/color]

    Code the cancel button to set your form's DialogResult to
    DialogResult.Ca ncel before closing itself. In the calling routine, bail
    if the user cancelled.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.


    (Pull the pin to reply)


    Comment

    • Guest's Avatar

      #3
      Re: showdialog login form - login fail, close the app

      Thanks!
      "Frank Oquendo" <frankopin@acad x.com> wrote in message
      news:OWOPzXLqDH A.964@TK2MSFTNG P10.phx.gbl...[color=blue]
      > Walter wrote:[color=green]
      > > Hi,
      > > I have a simple MDIChild login form that loads before the parent, and
      > > if the user hit's the cancel button on the login form, the whole app
      > > should unload. How can I do this? Thanks[/color]
      >
      > Code the cancel button to set your form's DialogResult to
      > DialogResult.Ca ncel before closing itself. In the calling routine, bail
      > if the user cancelled.
      >
      > --
      > There are 10 kinds of people. Those who understand binary and those who
      > don't.
      >
      > http://code.acadx.com
      > (Pull the pin to reply)
      >
      >[/color]


      Comment

      • Guest's Avatar

        #4
        Re: showdialog login form - login fail, close the app

        Got time for one more? How can I set a property on the mdiParent form from
        the Child form?
        thanks.
        "Frank Oquendo" <frankopin@acad x.com> wrote in message
        news:OWOPzXLqDH A.964@TK2MSFTNG P10.phx.gbl...[color=blue]
        > Walter wrote:[color=green]
        > > Hi,
        > > I have a simple MDIChild login form that loads before the parent, and
        > > if the user hit's the cancel button on the login form, the whole app
        > > should unload. How can I do this? Thanks[/color]
        >
        > Code the cancel button to set your form's DialogResult to
        > DialogResult.Ca ncel before closing itself. In the calling routine, bail
        > if the user cancelled.
        >
        > --
        > There are 10 kinds of people. Those who understand binary and those who
        > don't.
        >
        > http://code.acadx.com
        > (Pull the pin to reply)
        >
        >[/color]


        Comment

        • Morten Wennevik

          #5
          Re: showdialog login form - login fail, close the app

          Pass the parent as a paramter when you create the child.

          MyChild newChild = new MyChild(this);

          And add or change the constructor on the child class to accept a parent
          parameter

          private Parent parent;

          public MyChild(Parent parent)
          {
          this.parent = parent;
          }

          then call parent.Property when you need it

          --
          Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

          Comment

          • Guest's Avatar

            #6
            Re: showdialog login form - login fail, close the app

            Sorry, I keep getting the below error on these lines:

            private Parent parent;
            public MyChild(Parent parent)

            'System.Windows .Forms.Control. Parent' denotes a 'property' where a 'class'
            was expected

            thanks.

            "Morten Wennevik" <MortenWennevik @hotmail.com> wrote in message
            news:opryii7kmv hntkfz@localhos t...
            Pass the parent as a paramter when you create the child.

            MyChild newChild = new MyChild(this);

            And add or change the constructor on the child class to accept a parent
            parameter

            private Parent parent;

            public MyChild(Parent parent)
            {
            this.parent = parent;
            }

            then call parent.Property when you need it

            --
            Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


            Comment

            Working...