标题:如何在MSFlexGrid控件中添加下拉框?
只看楼主
xingming022
Rank: 1
等 级:新手上路
帖 子:103
专家分:9
注 册:2015-1-26
结帖率:50%
已结贴  问题点数:20 回复次数:2 
如何在MSFlexGrid控件中添加下拉框?
效果像附件中那样。
搜索更多相关主题的帖子: 如何 
2015-11-26 12:45
xiangyue0510
Rank: 14Rank: 14Rank: 14Rank: 14
等 级:贵宾
威 望:86
帖 子:934
专家分:5244
注 册:2015-8-10
得分:20 
窗体上先放一个combo,Visible = False
程序代码:
Dim rr As Integer
Dim cc As Integer

Private Sub Combo1_Click()
Combo1.Visible = False
MSFlexGrid1.TextMatrix(rr, cc) = Combo1.Text

End Sub

Private Sub Combo1_LostFocus()
Combo1_Click
End Sub

Private Sub MSFlexGrid1_DblClick()

'MsgBox MSFlexGrid1.CellTop & "," & MSFlexGrid1.CellHeight
'MsgBox MSFlexGrid1.CellLeft & "," & MSFlexGrid1.CellWidth


If Combo1.Visible = True Then Combo1_LostFocus

rr = MSFlexGrid1.Row
cc = MSFlexGrid1.Col
Combo1.Visible = True
Combo1.Left = MSFlexGrid1.Left + MSFlexGrid1.CellLeft
Combo1.Width = MSFlexGrid1.CellWidth

Combo1.Top = MSFlexGrid1.Top + MSFlexGrid1.CellTop
'Combo1.Height = MSFlexGrid1.CellHeight

Combo1.Text = MSFlexGrid1.Text

End Sub
2015-11-26 13:32
xingming022
Rank: 1
等 级:新手上路
帖 子:103
专家分:9
注 册:2015-1-26
得分:0 
回复 2楼 xiangyue0510
非常感谢~
2015-11-27 15:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-459617-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.043592 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved