0

i have a window form that has usename and a password but i cant get my 2 buttons submit and cancel to work dose anyone know where i could look to learn more on how to make my buttons work ty all

3
Contributors
5
Replies
7
Views
11 Years
Discussion Span
Last Post by asmith3006
0

You need to have a DialogResult item such as

DialogResult dr = newForm.ShowDialog();
            if (dr == DialogResult.OK)
            {//do something}

Then in your prompt you need to set the buttons to have the correct dialogue result values. You can either set these by code or by the property panel.

Hope that helps.

0

usually double clicking the buttons in the ide form design mode will automatically generate code for button events :)

0

usually double clicking the buttons in the ide form design mode will automatically generate code for button events :)

But that will be in the form CONTAINING the button rather than the form that called the dialogue box.

0

sorry all he asked was how to make a button to work and the window part was really irrelavant, so how can you say my answer is wrong :). and you forgot to mention you actually have to set how the buttons will return by changing the dialog results property of the button. '

0

Oops my bad. Answering what I thought was there not what is actually there.

Ignore my reply.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.