Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
280
Ribbon button: property "enabled" not working properly
posted

Hello,

I created a Ribbon and an UltraTabControl. The ribbon starts with all the buttons disabled

I'm trying to enable/disable a specific ribbon button ("Print Preview") in dependance of the selected tab

I used the property .SharedProps.Enabled = True, but it seems not working (the button remain disabled all the time). I already set this property StartForm.RibbonManager.Office2007UICompatibility = False

  Private Sub TabControl1_SelectedTabChanged(sender As Object, e As SelectedTabChangedEventArgs) Handles TabControl1.SelectedTabChanged

        Dim PreviewButton As ButtonTool = StartForm.RibbonManager.Tools("Print Preview")
        StartForm.RibbonManager.Office2007UICompatibility = False

        Select Case e.Tab.Key

            Case Is = 1        
                PreviewButton.SharedProps.Enabled = True


            Case Else          
                PreviewButton.SharedProps.Enabled = False

        End Select

        .......

Thanks in advance for the help

BR

Alberto