Click to See Complete Forum and Search --> : Resizing controls OnSize().


Simon Pettman
March 30th, 1999, 03:22 AM
I was just reading through the discussion board on information about MSFlexGrid, and found by accident a rather long

winded aproach to resizing a control within the parent window.

void CMlsfileView::OnSize(UINT nType, int cx, int cy)

{

CFormView::OnSize(nType, cx, cy);

// OnSize gets called before the controls have been

// created when using Dialog based applications.

// Using a flag prevents exceptions.

if (Grids_Created) // flag set to TRUE in OnInitial Update

{

m_Grid.MoveWindow(10,10,cx-20,cy-10);

// m_grid is MSFlexGrid member of the view.

}

}

Walter An
March 30th, 1999, 04:06 AM
Another way to check whether the control is created.


m_Grid.GetSafeHwnd() != NULL