C#::Hiding MenuStrip in MDIParent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ssknov
    New Member
    • Dec 2007
    • 40

    C#::Hiding MenuStrip in MDIParent

    hi

    i am creating a login page.Inthe form load itself i need to hide the MenuStrip in MDI Parent to HIDE, When the users gives the correct passwd and pushes the Loginbutton , My MDIParent1 forms menustrip should be visible .

    c my code . but it doesnt works. Any body pls clear my doubt.

    Code:
            private void LoginForm_Load(object sender, EventArgs e)
            {
                MDIParent1 mdifrm = new MDIParent1();
                
                mdifrm.menuStrip.Visible = false;
    I had created formobj mdifrm and made it visible false on load. this also not works.

    Code:
     private void btnLogin_Click_1(object sender, EventArgs e)
            {
                     if (strPasswd == dsUsers.Tables[0].Rows[0].ItemArray[0].ToString())
                    {
                      [B]  this.mdifrm.menuStrip.Visible = true;[/B]
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Incorrect Password","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
                    }
    
                }
    thanks in adv

    kssk
    Last edited by ssknov; Dec 20 '07, 07:32 AM. Reason: typing error
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    desable the menu items at design time and enable those after succesful enable only.

    Comment

    • ssknov
      New Member
      • Dec 2007
      • 40

      #3
      My code doesnt works , even if i am right

      i am hiding my MDI's menustrip in its load, when i click the button in form2 it should be visible. i tried in my code. it wont works. pls c my code again.

      help me

      thanks
      kssk

      Comment

      • Kevin xx
        New Member
        • Jul 2011
        • 1

        #4
        For those who are still interested..

        He forgot to add the mdifrm.Show(); call so the form was never showed to him in the first place.

        Comment

        Working...