Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » TabControl TabPage Click Check Collapse All
Subject Author Date
Paddy Dec 29, 2010 - 3:47 AM

Hi,

I am using Ribbon v3.7.



I have a TabControl on the form with many TabPages, I am attempting to check which Tab is clicked on so that something can happen.  I have the logic right, I think and I have used two methods but it doesn’t seem to be working.  It’s not doing what I want it to do, it’s not doing anything at all.



Pretty much, I am wanting to automatically place the cursor in a particular Textbox depending on which Tab is clicked on.  The methods I have tried are: TabIndexChanged and SelectedTabPageChanged


I am currently using the TabIndexChanged method with the following code:


Private Sub TabControl_UserSettings_TabIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl_UserSettings.TabIndexChanged

        With TabControl_UserSettings

            Select Case .SelectedTabPage.TabIndex

                Case 0 ’Applications

                    ’Set intial focus

                    txtFireFoxDefaultLocation.Focus()

                    ’Set tab index

                    SetApplicationsTabIndex()

                Case 1 ’Computer Type

                    ’Set intial focus

                    txtComputerType.Focus()

                    ’Set tab index

                    SetComputerTypeTabIndex()

                Case 2 ’Operating Systems

                    ’TODO

                Case 3 ’Operating System Type

                    ’TODO

                Case 4 ’Operating System Manufacturers

                    ’TODO

                Case 5 ’Referrer Type

                    ’TODO

                Case 6 ’Resolution Type

                    ’TODO

                Case 7 ’Service Packs

                    ’TODO

                Case 8 ’Website URLs

                    ’Set initial focus

                    txtIRCChatURL.Focus()

                    ’Set tab index

                    SetWebsiteURLsTabIndex()

            End Select

        End With

    End Sub

Paddy Dec 29, 2010 - 4:01 AM

Ok, after playing around, I have fixed it myself with the following code:


    Private Sub TabControl_UserSettings_SelectedTabPageChanged(ByVal sender As Object, ByVal e As Elegant.Ui.TabPageChangedEventArgs) Handles TabControl_UserSettings.SelectedTabPageChanged

        ’TODO:

        ’Focus not working

        Select Case TabControl_UserSettings.SelectedTabPage.Text

            Case "Applications"

                ’Set intial focus

                txtFireFoxDefaultLocation.Focus()

                ’Set tab index

                SetApplicationsTabIndex()

            Case "Computer Type"

                ’Set intial focus

                txtComputerType.Focus()

                ’Set tab index

                SetComputerTypeTabIndex()

            Case "Operating Systems"

                ’TODO

            Case "Operating System Type"

                ’TODO

            Case "Operating System Manufacturers"

                ’TODO

            Case "Referrer Type"

                ’TODO

            Case "Resolution Type"

                ’TODO

            Case "Service Packs"

                ’TODO

            Case "Website URLs"

                ’Set initial focus

                txtIRCChatURL.Focus()

                ’Set tab index

                SetWebsiteURLsTabIndex()

        End Select

    End Sub