如何在VC里面对MSFlexGrid控件进行输入。我也知道是在该控件上加一个浮动的编辑框,当用户单击时,显示编辑框,并接收输入,再送入MSFlexGrid控件显示,但具体如何来做呢。(我是一个刚刚开始学VC++的用户)。
         拜谢。

解决方案 »

  1.   

    void CEditGrid::OnEnterCellGrid()
    {
    UpdateData(TRUE);
    long row=GetRowSel();
    long col=GetColSel();
    MoveEdit(row, col);
    UpdateData(FALSE);
    }
    void CEditGrid::MoveEdit(long row,long col)
    {
    if (row<1 || col<1) return;
    m_edit.MoveWindow(((GetCellLeft() - m_lBorderWidth) * m_nLogX)/1440, 
    ((GetCellTop() - m_lBorderHeight) * m_nLogY)/1440,
    (GetCellWidth()* m_nLogX)/1440, 
    (GetCellHeight()* m_nLogY)/1440, FALSE); m_edit.SetWindowText(CEditGrid::GetTextMatrix(row,col));
    int iCount = m_edit.GetWindowTextLength();
    m_edit.SetSel(iCount,iCount);
    m_edit.ShowWindow(SW_SHOW);
    m_edit.SetFocus();
    }
      

  2.   

    MSFlexGrid控件本身不能进行输入,只能用其他方法实现,例如楼上的做法。