Hi,
You just have to get the parent and cast it to NDockingPanel - for example:
public class MyUserControl : UserControl { public MyUserControl() {
}
public string ParentKey { get { NDockingPanel dockPanel = this.Parent as NDockingPanel;
if (dockPanel == null) return string.Empty;
return dockPanel.Key; } } }
public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { NDockingPanel t_panel = new NDockingPanel(); t_panel.Key = "ABC";
MyUserControl control = new MyUserControl(); t_panel.Controls.Add(control);
Debug.WriteLine(control.ParentKey); } }
Best regards,Bob