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. Help MS FlexGrid SetColWidth problem! [modified]

Help MS FlexGrid SetColWidth problem! [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpcssquestion
2 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.
  • F Offline
    F Offline
    fantasy1215
    wrote on last edited by
    #1

    In a dialog based program, I insert a MS FlexGrid control, and I stretch the grid to fill the rect as I want. But use SetColWidth not set the column as wide as I want. my code below:

    m_grid.SetRows(3);
    m_grid.SetCols(2);
    m_grid.SetRow(0);
    m_grid.SetCol(0);
    m_grid.SetText(_T("name"));

    m_grid.SetRow(0);
    m_grid.SetCol(1);
    m_grid.SetText(_T("age"));
    CRect rcGrid;
    m_grid.GetClientRect(&rcGrid);
    int iColWidth = 0;
    iColWidth = rcGrid.Width()/2;
    m_grid.SetColWidth(0, iColWidth); //not half width of the rect!
    m_grid.SetColWidth(1, iColWidth); //not half width of the rect!

    BTW, is there any links I can get help of MS FlexGrid or code samples? So I don't have to ask every functions here!

    modified on Monday, August 25, 2008 4:21 AM

    F 1 Reply Last reply
    0
    • F fantasy1215

      In a dialog based program, I insert a MS FlexGrid control, and I stretch the grid to fill the rect as I want. But use SetColWidth not set the column as wide as I want. my code below:

      m_grid.SetRows(3);
      m_grid.SetCols(2);
      m_grid.SetRow(0);
      m_grid.SetCol(0);
      m_grid.SetText(_T("name"));

      m_grid.SetRow(0);
      m_grid.SetCol(1);
      m_grid.SetText(_T("age"));
      CRect rcGrid;
      m_grid.GetClientRect(&rcGrid);
      int iColWidth = 0;
      iColWidth = rcGrid.Width()/2;
      m_grid.SetColWidth(0, iColWidth); //not half width of the rect!
      m_grid.SetColWidth(1, iColWidth); //not half width of the rect!

      BTW, is there any links I can get help of MS FlexGrid or code samples? So I don't have to ask every functions here!

      modified on Monday, August 25, 2008 4:21 AM

      F Offline
      F Offline
      fantasy1215
      wrote on last edited by
      #2

      Need your help!

      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