Sunday, August 12, 2018

Overriding ShowDialog in C

Overriding ShowDialog in C


Overriding ShowDialog() is not possible in WinForms because there is no overridable method declared for it in Form Class. But there is a way there is will:


 public partial class FormA : Form
{
public FormA()
{
InitializeComponent();
}

public DialogResult ShowDialog(string mes)
{
this.textBox1.Text = mes;
return base.ShowDialog();
}
 public DialogResult ShowDialog()
{
// Your Code
return base.ShowDialog();
}
 }


visit link download