Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Change Tabs in Ribbon Control dynamically - C++

Change Tabs in Ribbon Control dynamically - C++

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++question
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gopi Nath
    wrote on last edited by
    #1

    Hello Everybody, In our application we have added a Ribbon control with multiple tabs. Is there anyway to select / change tabs through code? I can see an option available in C# (SelectedIndex), like that is there anything available in C++ also? for eg, I am in 3rd tab in my application, and when I reset, first tab needs to be selected. Thanks in advance. Regards, Gopinath.

    L 1 Reply Last reply
    0
    • G Gopi Nath

      Hello Everybody, In our application we have added a Ribbon control with multiple tabs. Is there anyway to select / change tabs through code? I can see an option available in C# (SelectedIndex), like that is there anything available in C++ also? for eg, I am in 3rd tab in my application, and when I reset, first tab needs to be selected. Thanks in advance. Regards, Gopinath.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You can set IsSelected to true on the RibbonTab you want to select.

      G 1 Reply Last reply
      0
      • L Lost User

        You can set IsSelected to true on the RibbonTab you want to select.

        G Offline
        G Offline
        Gopi Nath
        wrote on last edited by
        #3

        Hi Thaddeus Jones, Thanks for your reply. I don't see any option like isSelected in RibbonControl tabs. Can you give me a sample code if any, so that I will get some idea. Regards, Gopi.

        L 1 Reply Last reply
        0
        • G Gopi Nath

          Hi Thaddeus Jones, Thanks for your reply. I don't see any option like isSelected in RibbonControl tabs. Can you give me a sample code if any, so that I will get some idea. Regards, Gopi.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          It's on the RibbonTab: RibbonTab.IsSelected Property (System.Windows.Controls.Ribbon)[^].

          G Richard Andrew x64R 2 Replies Last reply
          0
          • L Lost User

            It's on the RibbonTab: RibbonTab.IsSelected Property (System.Windows.Controls.Ribbon)[^].

            G Offline
            G Offline
            Gopi Nath
            wrote on last edited by
            #5

            Hi, Thanks again. Let me give this a try and let you know. Regards, Gopi.

            1 Reply Last reply
            0
            • L Lost User

              It's on the RibbonTab: RibbonTab.IsSelected Property (System.Windows.Controls.Ribbon)[^].

              Richard Andrew x64R Offline
              Richard Andrew x64R Offline
              Richard Andrew x64
              wrote on last edited by
              #6

              Your answer is for the .NET Framework, but I think the OP's question is about native C++.

              The difficult we do right away... ...the impossible takes slightly longer.

              L G 2 Replies Last reply
              0
              • Richard Andrew x64R Richard Andrew x64

                Your answer is for the .NET Framework, but I think the OP's question is about native C++.

                The difficult we do right away... ...the impossible takes slightly longer.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Because of the comparison with the C# version I expected it to be about the same control, but you may be right. In the CMFCRibbonBar, tabs are called categories and they can be set with SetActiveCategory().

                G 1 Reply Last reply
                0
                • Richard Andrew x64R Richard Andrew x64

                  Your answer is for the .NET Framework, but I think the OP's question is about native C++.

                  The difficult we do right away... ...the impossible takes slightly longer.

                  G Offline
                  G Offline
                  Gopi Nath
                  wrote on last edited by
                  #8

                  Hi Richard, Yes, you are right, its for C++ only. Regards, Gopi.

                  1 Reply Last reply
                  0
                  • L Lost User

                    Because of the comparison with the C# version I expected it to be about the same control, but you may be right. In the CMFCRibbonBar, tabs are called categories and they can be set with SetActiveCategory().

                    G Offline
                    G Offline
                    Gopi Nath
                    wrote on last edited by
                    #9

                    I think, this will not work for my solution. Anyways, let me try.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups