Switching tabs Blank Title 104030

You can also use the csm to pull a reference to the control using the guid.
Cast it back to a tab and call 'focus'.
Either way works, but this'll save you a couple lines of code.

On Tue, Sep 13, 2011 at 1:16 PM, sanfordm99 <sanfordm99@...> wrote:

> **
>
>
> That worked Great! You were right about the names, I would have never
> guessed.
>
> Thanks for the help,
> -Mike
>
>
> --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@...> wrote:
> >
> > I have done it this way, there may be better ways.....
> >
> > Imports System.Reflection
> > Imports System.Collections
> >
> > Define a variable to work with in your code:
> >
> > Private pnlMyPanel As New
> Infragistics.Win.UltraWinDock.DockableControlPane()
> >
> > Create a Sub to loop through the panels and assign your variable to the
> panel you want:
> >
> > Private Sub FindMyPanel(Optional ByRef ctls As
> System.Windows.Forms.Control.ControlCollection = Nothing)
> >
> > ' Enumerate the forms controls looking for the Epicor dock manager
> > If ctls Is Nothing Then ctls = oTrans.EpiBaseForm.Controls
> > For Each ctl As Control In ctls
> >
> > If ctl.HasChildren Then FindMyPanel(ctl.Controls)
> >
> > If TypeOf(ctl) Is Infragistics.Win.UltraWinDock.WindowDockingArea Then
> >
> > Dim objDockManager As Object = ctl.GetType ().InvokeMember("DockManager",
> BindingFlags.GetProperty Or BindingFlags.NonPublic Or BindingFlags.Instance
> Or BindingFlags.IgnoreCase, Nothing, ctl, Nothing)
> > ' Once found get a handle to the Infragistics dock manager using
> relection
> > Dim udm As Infragistics.Win.UltraWinDock.UltraDockManager = CType
> (objDockManager, Infragistics.Win.UltraWinDock.UltraDockManager)
> >
> > For Each p As Infragistics.Win.UltraWinDock.DockableControlPane In
> udm.ControlPanes
> > If (p.Key.ToString = "<the name of the panel you are looking for>") Then
> > pnlMyPanel = p
> >
> > End If
> > 'MessageBox.Show(p.ToString())
> > Next
> >
> > End If
> > Next
> >
> > End Sub
> >
> > Call the Sub in the Form Load event
> >
> > then you use pnlMyPanel.Activate() or pnlMyPanel.Close() to control the
> panel
> >
> > Sometimes the panle names are not intuitive - uncomment
> 'MessageBox.Show(p.ToString()) to show the names of all the panels as they
> are looped through to find the name of the desired panel
> >
> > As always - the group message editor mangles long lines so beware of line
> wrapping if you copy and paste code
> >
> > bw
> >
> > --- In vantage@yahoogroups.com, "sanfordm99" <sanfordm99@> wrote:
> > >
> > > How can I switch tabs on a form, such as UD101. I have a button on the
> child detail panel, that should switch the view back to its parent
> (detailPanel1) after completing its code. I have tried a few things such as
> UD101Form.ActivateSheet("detailPanel1") without any luck.
> > >
> > > Thanks,
> > > Mike
> > >
> >
>
>
>



--
*Waffqle Driggers*
*High End Dev, System Design, Profit Drinking
*
*:: 904.962.2887*
*:: waffqle@...*
*:: NO FAXES*

*

*


[Non-text portions of this message have been removed]
How can I switch tabs on a form, such as UD101. I have a button on the child detail panel, that should switch the view back to its parent (detailPanel1) after completing its code. I have tried a few things such as UD101Form.ActivateSheet("detailPanel1") without any luck.

Thanks,
Mike
I have done it this way, there may be better ways.....

Imports System.Reflection
Imports System.Collections

Define a variable to work with in your code:

Private pnlMyPanel As New Infragistics.Win.UltraWinDock.DockableControlPane()

Create a Sub to loop through the panels and assign your variable to the panel you want:

Private Sub FindMyPanel(Optional ByRef ctls As System.Windows.Forms.Control.ControlCollection = Nothing)

' Enumerate the forms controls looking for the Epicor dock manager
If ctls Is Nothing Then ctls = oTrans.EpiBaseForm.Controls
For Each ctl As Control In ctls

If ctl.HasChildren Then FindMyPanel(ctl.Controls)

If TypeOf(ctl) Is Infragistics.Win.UltraWinDock.WindowDockingArea Then

Dim objDockManager As Object = ctl.GetType ().InvokeMember("DockManager", BindingFlags.GetProperty Or BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.IgnoreCase, Nothing, ctl, Nothing)
' Once found get a handle to the Infragistics dock manager using relection
Dim udm As Infragistics.Win.UltraWinDock.UltraDockManager = CType (objDockManager, Infragistics.Win.UltraWinDock.UltraDockManager)

For Each p As Infragistics.Win.UltraWinDock.DockableControlPane In udm.ControlPanes
If (p.Key.ToString = "<the name of the panel you are looking for>") Then
pnlMyPanel = p

End If
'MessageBox.Show(p.ToString())
Next

End If
Next

End Sub

Call the Sub in the Form Load event

then you use pnlMyPanel.Activate() or pnlMyPanel.Close() to control the panel

Sometimes the panle names are not intuitive - uncomment 'MessageBox.Show(p.ToString()) to show the names of all the panels as they are looped through to find the name of the desired panel

As always - the group message editor mangles long lines so beware of line wrapping if you copy and paste code

bw

--- In vantage@yahoogroups.com, "sanfordm99" <sanfordm99@...> wrote:
>
> How can I switch tabs on a form, such as UD101. I have a button on the child detail panel, that should switch the view back to its parent (detailPanel1) after completing its code. I have tried a few things such as UD101Form.ActivateSheet("detailPanel1") without any luck.
>
> Thanks,
> Mike
>
That worked Great! You were right about the names, I would have never guessed.

Thanks for the help,
-Mike

--- In vantage@yahoogroups.com, "bw2868bond" <bwalker@...> wrote:
>
> I have done it this way, there may be better ways.....
>
> Imports System.Reflection
> Imports System.Collections
>
> Define a variable to work with in your code:
>
> Private pnlMyPanel As New Infragistics.Win.UltraWinDock.DockableControlPane()
>
> Create a Sub to loop through the panels and assign your variable to the panel you want:
>
> Private Sub FindMyPanel(Optional ByRef ctls As System.Windows.Forms.Control.ControlCollection = Nothing)
>
> ' Enumerate the forms controls looking for the Epicor dock manager
> If ctls Is Nothing Then ctls = oTrans.EpiBaseForm.Controls
> For Each ctl As Control In ctls
>
> If ctl.HasChildren Then FindMyPanel(ctl.Controls)
>
> If TypeOf(ctl) Is Infragistics.Win.UltraWinDock.WindowDockingArea Then
>
> Dim objDockManager As Object = ctl.GetType ().InvokeMember("DockManager", BindingFlags.GetProperty Or BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.IgnoreCase, Nothing, ctl, Nothing)
> ' Once found get a handle to the Infragistics dock manager using relection
> Dim udm As Infragistics.Win.UltraWinDock.UltraDockManager = CType (objDockManager, Infragistics.Win.UltraWinDock.UltraDockManager)
>
> For Each p As Infragistics.Win.UltraWinDock.DockableControlPane In udm.ControlPanes
> If (p.Key.ToString = "<the name of the panel you are looking for>") Then
> pnlMyPanel = p
>
> End If
> 'MessageBox.Show(p.ToString())
> Next
>
> End If
> Next
>
> End Sub
>
> Call the Sub in the Form Load event
>
> then you use pnlMyPanel.Activate() or pnlMyPanel.Close() to control the panel
>
> Sometimes the panle names are not intuitive - uncomment 'MessageBox.Show(p.ToString()) to show the names of all the panels as they are looped through to find the name of the desired panel
>
> As always - the group message editor mangles long lines so beware of line wrapping if you copy and paste code
>
> bw
>
> --- In vantage@yahoogroups.com, "sanfordm99" <sanfordm99@> wrote:
> >
> > How can I switch tabs on a form, such as UD101. I have a button on the child detail panel, that should switch the view back to its parent (detailPanel1) after completing its code. I have tried a few things such as UD101Form.ActivateSheet("detailPanel1") without any luck.
> >
> > Thanks,
> > Mike
> >
>