Resizing a wxGrid's column to make grid fit client space

Volker Bartheld dr_versaeg at freenet.de
Wed Sep 12 05:06:39 PDT 2007


Hi!

I'm using something like

void wxMyGrid::ResizeByCol(int col)
{
  int i, iSize=0;
  for(i=0; i<m_numCols; ++i) if(i!=col) iSize+=GetColSize(i);
  SetColSize(col, GetClientSize().GetWidth()-iSize);
  ForceRefresh();
}

in my custom wxGrid class. Unfortunately, I still get a horizontal
scrollbar. Should I add some kind of offset (where do I get the its value?)
or which is the correct way to expand a column of a wxGrid in a way that it
maximally fits/fills the client space?

Thanks for any advice!


Volker
  
-- 
mailto:  V B A R T H E L D at G M X dot D E






More information about the wx-users mailing list