Community
Showing results for 
Search instead for 
Do you mean 
Reply

Change Tab order programatically

Copper Super Contributor
Posts: 88
Country: USA

Change Tab order programatically

Is it possible to programmatically change the Tab order in ACT?

 

I have a Custom Tab Plugin that I would like to move closer to the left in the order of the Tabs in a ContactDetail view. For instance, I would like to move it to the left of the "Histories" tab in Act.

 

Is this possible? If so, does anyone have code to accomplish this?

 

Thanks.

Employee
Posts: 1,163
Country: USA

Re: Change Tab order programatically

I dont' believe so, the order that the tabs appear in is an aspect of the layout and I don't know that there is a way to alter those programmatically.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Super Contributor
Posts: 88
Country: USA

Re: Change Tab order programatically

Ok - I'll vote to add the ability to change the Tab Order of all visible tabs in ACT!

Employee
Posts: 1,163
Country: USA

Re: Change Tab order programatically

You may already know this, but you can change the order of the tabs manually via the layout designer. In the designer go Edit -> Tabs and you can sets tabs invisible and alter their order.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Super Contributor
Posts: 88
Country: USA

Re: Change Tab order programatically

I know I can rearrange the Tabs inside of ACT!. What I'd like to do is to move my Plugin tab left in the tab order. As I understand it, my plugin loads after all of the ACT! tabs load, so that my Plugin tab is the last one on the right.

 

I'd like to move my Plugin tab to, say, the 4th Tab in ACT!, instead of the last Tab.

Copper Super Contributor
Posts: 293
Country: United States

Re: Change Tab order programatically

This would be a nice enhancement as all plug-ins show up to the right but are not reorderable.  I'd like to do this as between the Swiftpage tab, QuickBooks integration, Custom Tables, etc. -- me my clients want to reorder for business process flow purposes as one looks left to right with some semblence of order.

 

PF

Copper Super Contributor
Posts: 112
Country: Australia

Re: Change Tab order programatically

[ Edited ]

how about this.. you can find by tag etc.. have a play

dont forget to add a reference to ACT.UI.TabPage and pass in the contact form

 

    Private Sub ActApp_Open(ByVal sender As Object, ByVal e As System.EventArgs) Handles ActApp.Open

        Dim view As Form = DirectCast(ActApp.CurrentView, Form)

        ccontrols(view)

    EndSub

 

    Private Sub ccontrols(ByVal ctl As Control)

        For Each c As Control In ctl.Controls

            If TypeOf c Is System.Windows.Forms.TabPage Then

                Dim tp As Act.UI.TabPage.ActTabPage = CType(c, Act.UI.TabPage.ActTabPage)

                'If tp.Tag = "MyCustomTabpageTab" Then

                'If tp.Text = "User Fields" Then

                Dim tpp As Act.UI.TabPage.ActTabControl = CType(tp.Parent, Act.UI.TabPage.ActTabControl)

                'tpp.GetTabPage()

                'tpp.GetTabPageByEntityName()

                'tpp.TabPages.Item("Key")

                '11 is the "User Fields" tab page

                Dim cTp As System.Windows.Forms.TabPage = tpp.TabPages.Item(11)

                tpp.TabPages.RemoveAt(11)

                tpp.TabPages.Insert(1, cTp)

                Exit Sub

            Else

            If c.Controls.Count > 0 Then

                For Each t As Control In c.Controls

                    ccontrols(t)

                Next

            End If

            End If

        Next

 

    EndSub

 

Copper Super Contributor
Posts: 88
Country: USA

Re: Change Tab order programatically

Excellent!

 

I can move the 11th tab using this code. We're real close..

 

If I have a Tab named "MyTab" as my custom Plugin Tab name, how do I get the Index for that Tab?

 

For instance, if "MyTab" is the 13th Tab in the TabCollection, how do I get the Index of my Tab, so that I can move it?

Copper Super Contributor
Posts: 112
Country: Australia

Re: Change Tab order programatically

quickest thing off the top of my head, and there might be a better way not sure.. would be the just loop each of the tabapges in the collection and test if the tab is My Tab

 

i know there is gettab by tag, index.. so if you can add it with a tag.. but looping might be the best way.. i dont remember seeing a public property for index thou to make things easySmiley Happy

Copper Super Contributor
Posts: 88
Country: USA

Re: Change Tab order programatically

Update:

 

I am able to assign a Tab position for my Plugin when ACT! loads. In my Plugin, I have the user select which position number they want for my Tab. When ACT! loads, my Tab is in the correct position.

 

I have not been able to figure out how to Refresh() my tab so that the Tab order changes while ACT! is running. Currently, I have to close out and restart ACT! for the change to take place. When I try to program the change in the Tab within my Plugin, it creates 2 of my Tabs - one in the old position and one in the new.

 

I'll update this blog when I figure it out...