// TODO: Add your specialized code here and/or call the base class
int i = 1; } void CHQBJ_form::OnSize(UINT nType, int cx, int cy) { CFormView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here RECT rect; GetClientRect(&rect); CMSFlexGrid *grid = (CMSFlexGrid *)GetDlgItem(IDC_QUOTE_GRID); if (grid) grid->MoveWindow(&rect); }
在OnInitialUpdate()中设一个断点,看看能不能跟踪进去.
class CHQBJ_form : public CFormView { protected: CHQBJ_form(); // protected constructor used by dynamic creation DECLARE_DYNCREATE(CHQBJ_form)// Form Data public: //{{AFX_DATA(CHQBJ_form) enum { IDD = IDD_HQBJ_FORM }; CMSFlexGrid m; //}}AFX_DATA// Attributes public:// Operations public:
// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CHQBJ_form) public: virtual void OnInitialUpdate(); virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL// Implementation protected: virtual ~CHQBJ_form(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif // Generated message map functions //{{AFX_MSG(CHQBJ_form) afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnMouseUpQuoteGrid(short Button, short Shift, long x, long y); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); DECLARE_EVENTSINK_MAP() //}}AFX_MSG DECLARE_MESSAGE_MAP() };///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_HQBJ_FORM_H__45CB608F_B365_4CCE_87C9_00E9ADB6355A__INCLUDED_)
{
CFormView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
int i = 1; }
void CHQBJ_form::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
RECT rect;
GetClientRect(&rect);
CMSFlexGrid *grid = (CMSFlexGrid *)GetDlgItem(IDC_QUOTE_GRID);
if (grid)
grid->MoveWindow(&rect);
}
{
protected:
CHQBJ_form(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CHQBJ_form)// Form Data
public:
//{{AFX_DATA(CHQBJ_form)
enum { IDD = IDD_HQBJ_FORM };
CMSFlexGrid m;
//}}AFX_DATA// Attributes
public:// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHQBJ_form)
public:
virtual void OnInitialUpdate();
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL// Implementation
protected:
virtual ~CHQBJ_form();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif // Generated message map functions
//{{AFX_MSG(CHQBJ_form)
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnMouseUpQuoteGrid(short Button, short Shift, long x, long y);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
DECLARE_EVENTSINK_MAP()
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_HQBJ_FORM_H__45CB608F_B365_4CCE_87C9_00E9ADB6355A__INCLUDED_)