Home › Forums › WinForms controls › Other WinForms controls › docking windows toolwindows
I have a user control in a docking window. on the UC I have a button. I would like to set the button visible from another form
right now, this works to show the docked window.
objSwitchboard.dlmSwitchboard.ToolWindows(0).State = ToolWindowState.Docked
but I don’t know how to refer to a control on the toolwindow.
Here is how I build it at the beginning on the switchboard form.
Me.dlmSwitchboard.ToolWindows.Add(New ucSpending) Me.dlmSwitchboard.ToolWindows(0).DockTo(DockTargetHost.DockHost, DockPosition.Right) Me.dlmSwitchboard.ToolWindows(0).State = ToolWindowState.AutoHide Me.dlmSwitchboard.AllowFloating = False Me.dlmSwitchboard.AllowHide = False
Imported from legacy forums. Posted by Tony (had 2899 views)
I figured this out.
objSwitchboard.dlmSwitchboard.ToolWindows(0).Controls(1).Controls(0).Visible = False
Is this the best method available?
Imported from legacy forums. Posted by Tony (had 324 views)
That’s the way to go. However, you can also use the names of the controls, instead of the index.
e.g.: this.dockLayoutManager1.ToolWindows[ “toolWindowKey” ].Controls[ “textBox1” ].Text = “new text”;
Imported from legacy forums. Posted by André (had 3866 views)