在控件MSHFlexGrid或DataGrid中如何使用下拉式列表!!!

xu 2000-02-23 04:21:00
我想在MSHFlexGrid或DataGrid控件中使用下拉式列表框,如何做,急急!!!
...全文
215 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cloud 2000-02-23
  • 打赏
  • 举报
回复
在DATAGRID中:
1。设置要出现下拉框的列的button属性为true.
2。加一个list box控件。
3。
Private Sub dgdIntRate_ButtonClick(ByVal ColIndex As Integer)
On Error GoTo ErrHandler

Select Case ColIndex
Case 0:

With dgdIntRate.Columns(ColIndex)
lstPdtCurrInd.Width = .Width
lstPdtCurrInd.Left = .Left + dgdIntRate.Left
lstPdtCurrInd.Top = .Top + Me.dgdIntRate.Top + _
Me.dgdIntRate.RowTop(Me.dgdIntRate.Row)

End With

lstPdtCurrInd.ZOrder (0)
lstPdtCurrInd.Visible = True
lstPdtCurrInd.SetFocus
/////////////////////////////////////////////////
Private Sub lstPdtCurrInd_Click()
If nAddNew Then
recTmpIntRate.AddNew
nAddNew = False
End If
If dgdIntRate.Columns(0).Value <> Empty Then
If dgdIntRate.Columns(0).Value <> lstPdtCurrInd.Text Then
recTmpIntRate("Pdt.-Curr.-Cd") = ""
dgdIntRate.Columns(0).Value = lstPdtCurrInd.Text
End If
End If
dgdIntRate.Columns(0).Value = lstPdtCurrInd.Text

dgdIntRate.DataChanged = True

lstPdtCurrInd.Visible = False
End Sub
//////////////////////////////////////////
如果是MSHFlexGrid改list box 为combo box
MSHFlexGrid没有button属性,在gid得到焦点时
显示combo box。
forgettor 2000-02-23
  • 打赏
  • 举报
回复
在窗体上加入一个组合框,判断格子的索引,计算位置,放置组合框控件(mshflexgrid似乎可以计算位置(.left?))

1,451

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧