accessing ok.DialogResult inside a function
- by sayyad
I am writing function which accepts user input from textbox. Action will take place when ok button is clicked. i made button(DialogResult=OK). code looks like
private void canny()
{
//
if (this.DialogResult == DialogResult.OK)
{
MessageBox.Show("ok");
}
//to Do
}
But I can't see any messagebox. What I am missing.
private void ok_Click(object sender, EventArgs e)
{
// should I add here some thing
}
Should I add control
Form1.Control.Add(Ok)?????????????????? if yes in which part of code.
regards,