请教在MSHFLEXGRID或DATAGRID控件中有什么方法可以实现按ENTER键自动从一个单元格跳动另一个单元格?

解决方案 »

  1.   

    在mshflexgrid的keypress事件中加
        If KeyAscii = 13 Then 
              mshflexgrid1.col=mshflexgrid1.col+1'移到下一列
        End if
     
      

  2.   

    If KeyAscii = 13 Then 
         if mshflexgrid1.col = mshflexgrid1.cols-1 then
              mshflexgrid1.col=0
              mshflexgrid1.row=mshflexgrid1.row+1
         else
              mshflexgrid1.col=mshflexgrid1.col+
    End if
      

  3.   

    不好意思,忘了加end if,呵呵,应该是:
    If KeyAscii = 13 Then 
         if mshflexgrid1.col = mshflexgrid1.cols-1 then
              mshflexgrid1.col=0
              mshflexgrid1.row=mshflexgrid1.row+1
         else
              mshflexgrid1.col=mshflexgrid1.col+1
         end if
    End if