StrataFrame Forum

Handle mulitiple Themed Tool Strip

http://forum.strataframe.net/Topic26145.aspx

By Vikas Gupta - 2/21/2010

we are usingThemedToolStrip with 3 buttons,
a PanelManager with 3 pages(Page1,Page2,Page3),each page hav own BuinessObject and MaintenanceFormToolStrip.
it switches. When you click button1, 2 n 3

we required again another ThemedToolStrip2 Contain 4 Button n PanelManager with 4 Pages On Page1 .

All 4 pages hav different-2 own BuinessObject and

MaintenanceFormToolStrip.

is it possible??

MaintenanceFormToolStrip

By Dustin Taylor - 2/22/2010

Yes. As Edhy has already answered in a previous thread of yours, you can change the PrimaryBusinessObject of the form in code whenever your panel manager page changes.  Here is Edhy's response in that thread in case you missed it:

----------------------

I Vikas,

If you want to go this route, then in the PanelManager.PageActivated event set the Form.PrimaryBusinessObject to the corresponding BO. Something like this may work, I have not tested


Private Sub PanelManager1_PageActivated(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.PanelPageEventArgs) Handles PanelManager1.PageActivated
Select Case Me.PanelManager1.CurrentPage.Name
Case Is = PageCustomers.Name
Me.PrimaryBusinessObject = Me.CustomersBO1

Case Is = PageOrders.Name
Me.PrimaryBusinessObject = Me.OrdersBO1

Case Is = PageOrderItems.Name
Me.PrimaryBusinesObject = Me.OrderItemsBO1
End Select
By Edhy Rijo - 2/22/2010

Adding to Dustin remark, you can have one ToolStripmenu to handle all your panels and simply set the button's visible property based on the panel manager being activated which would be the same place to change or reassign the form's primary business object, but if you prefer to have one menu per BO, then that will be more difficult since you will have to manually handle the BO events to set all the menu buttons. Just give it a try, it will work! Hehe