hi all just i wanna know how can i use condition with message box
i used the statment:

MessageBox.Show("Are you Sure?","collection", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
           if(DialogResult.Yes=) ;
           {
               this.Hide();
               MessageBox.Show(M, "collection", MessageBoxButtons.OK);
           }

but its dont work can any one hel plz im so beginner at c#.......


*how i can use timer count 60 min from 60-0 show the countdown in lable for more then one form........:)

Something like

DialogResult result = MessageBox.Show("Are you Sure?","collection", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
    if(result == DialogResult.Yes)
    {
        this.Hide();
        MessageBox.Show(M, "collection", MessageBoxButtons.OK);
    }

??

commented: Good answer. +6

aha thanx alot...:)

Hello Dear
Try this one

DialogResult = MessageBox.Show("Are you Sure?","collection", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
       if(DialogResult == DialogResult.Yes) ;
       {
           this.Hide();
           MessageBox.Show(M, "collection", MessageBoxButtons.OK);
       }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.