首页上一页 1 下一页尾页 3 条记录 1/1页
MSHFlexGrid点击单元格添加TextBox的问题
发表在VB答疑区
2007-11-08
是否精华
是
否
版块置顶:
是
否
老师,我学习了您们出版的《VB开发技术大全》中的相关代码,但我这段代码为什么点击MSHFlexGrid第二列单元格时只执行了 If MhGrid.Col = 2 Then这一语句,然后就跳到了End If,中间的语句却没有执行呢?控件属性设置都与例子一样,MSHFlexGrid的SelectionMode设为0。到底还能有那里错了呢,望老师指点迷津,谢谢!
Private Sub MhGrid_Click()
If MhGrid.Col = 2 Then
edTxt.Width = MhGrid.CellWidth
edTxt.Height = MhGrid.CellHeight
edTxt.Left = MhGrid.CellLeft + MhGrid.Left
edTxt.Top = MhGrid.CellTop + MhGrid.Top
edTxt.Text = MhGrid.Text
edTxt.Visible = True
edTxt.SetFocus
End If
End Sub
Private Sub MhGrid_Click()
If MhGrid.Col = 2 Then
edTxt.Width = MhGrid.CellWidth
edTxt.Height = MhGrid.CellHeight
edTxt.Left = MhGrid.CellLeft + MhGrid.Left
edTxt.Top = MhGrid.CellTop + MhGrid.Top
edTxt.Text = MhGrid.Text
edTxt.Visible = True
edTxt.SetFocus
End If
End Sub