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. CMFCRibbonButton with custom width

CMFCRibbonButton with custom width

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 2 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.
  • A Offline
    A Offline
    A Ms
    wrote on last edited by
    #1

    I want to Create CMFCRibbonButton control with custom width independent of it's caption length. and even I want know if I could change their width dynamically (at running time)

    E 1 Reply Last reply
    0
    • A A Ms

      I want to Create CMFCRibbonButton control with custom width independent of it's caption length. and even I want know if I could change their width dynamically (at running time)

      E Offline
      E Offline
      Eugen Podsypalnikov
      wrote on last edited by
      #2

      Try CMFCRibbonBaseElement::Get/SetRect(..) :) To my intuition it should be used at creation time, or you will call something like "ReAdjustLayout" for the parent bar/pane after the setting of the rectangle at RT... :)

      virtual void BeHappy() = 0;

      A 1 Reply Last reply
      0
      • E Eugen Podsypalnikov

        Try CMFCRibbonBaseElement::Get/SetRect(..) :) To my intuition it should be used at creation time, or you will call something like "ReAdjustLayout" for the parent bar/pane after the setting of the rectangle at RT... :)

        virtual void BeHappy() = 0;

        A Offline
        A Offline
        A Ms
        wrote on last edited by
        #3

        It was so surprising to me when i found that actually these two methods (CMFCRibbonBaseElement::SetRect and CMFCRibbonBaseElement::GetRect) do nothing, even after creating your ribbon element and put it in the ribbon menu you can't retrieve the dimensions of your element with CMFCRibbonBaseElement::GetRect and the only thing it gives is a rect object with zero dimentions :doh:

        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