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. Property Grid alignment issue with sub-group

Property Grid alignment issue with sub-group

Scheduled Pinned Locked Moved C / C++ / MFC
c++csscomhelpquestion
1 Posts 1 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.
  • M Offline
    M Offline
    Maximilien
    wrote on last edited by
    #1

    I am creating a simple property grid (CMFCPropertyGridCtrl) containing sub groups (value list) There is a alignment issue for the sub groups where the labels are drawn with a left offset (see in particular the "Level2" label) Why is the "Level2" label not aligned the same was as the "Level1" label? I would imagine that it should be aligned at the same level as the "subLevel1" label. See screenshot : http://imgur.com/9JeC4iz Here is how I code the property grid:

    CMFCPropertyGridProperty\* level1Group = new CMFCPropertyGridProperty(\_T("Level1"), 0, TRUE );
    CMFCPropertyGridProperty\* subLevel1 = new CMFCPropertyGridProperty(\_T("subLevel1"), \_T("subLevel1"), \_T("subLevel1") );
    level1Group->AddSubItem(subLevel1);
    
    CMFCPropertyGridProperty\* level2Group = new CMFCPropertyGridProperty(\_T("Level2"), 0, TRUE );
    CMFCPropertyGridProperty\* subLevel21 = new CMFCPropertyGridProperty(\_T("SubLevel2.1"), \_T("SubLevel2.1"), \_T("SubLevel2.1") );
    CMFCPropertyGridProperty\* subLevel22= new CMFCPropertyGridProperty(\_T("SubLevel2.2"), \_T("SubLevel2.2"), \_T("SubLevel2.2") );
    CMFCPropertyGridProperty\* subLevel23 = new CMFCPropertyGridProperty(\_T("SubLevel2.3"), \_T("SubLevel2.3"), \_T("SubLevel2.3") );
    
    level2Group->AddSubItem(subLevel21);
    level2Group->AddSubItem(subLevel22);
    level2Group->AddSubItem(subLevel23);
    level1Group->AddSubItem(level2Group);
    m\_PropertyGrid.AddProperty(level1Group);
    

    I tried inheriting my own CMFCPropertyGridProperty class and overwrite the OnDrawName but because of many protected members in the base class. (see CMFCPropertyGridProperty::OnDrawName in afxpropertygridctrl.cpp ) Now, I did overwrite the OnDrawName method, but removed lot of code that was in the base method that did not compile (access to protected members); but it seems to be OK. Thanks. Max.

    I'd rather be phishing!

    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