you can do this easily when you click on user control back button just fire your master windows back button.
For this create one public method on your master windows and call that method on your user control back button.
this is my MstaerPage
namespace TestProject
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void message()
{
MessageBox.Show("hi");
}
private void button2_Click(object sender, EventArgs e)
{
UserControl1 u = new UserControl1();
this.Controls.Add(u);
}
}
}
this is my usercontrol
namespace TestProject
{
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form1 f = new Form1();
f.message();
}
}
}
//when i click on user controls button it will show me the message of master page. pritesh2010
Posting Whiz in Training
261 posts since Mar 2010
Reputation Points: 40
Solved Threads: 46