MSFlexGrid控件问题

thw19850316 2007-04-09 02:56:26
请问怎么设置MSFlexGrid的一列为ComboBox,一列为CheckBox,一列为Button?
...全文
275 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
thw19850316 2007-04-10
  • 打赏
  • 举报
回复
guyehanxinlei(孤夜寒心泪)
程序在“imgBtnUp”处出错,说它没定义,要怎么定义?
lyjun_311 2007-04-10
  • 打赏
  • 举报
回复
vsflexgrid的按钮效果是,combosearch设置3 editable设置为2 showcombobutton设置为2
下拉框效果设置 ColComboList的值类似a|b|c就有a b c三个下来选项
dingyanwei 2007-04-10
  • 打赏
  • 举报
回复
花钱买一个吧,最多300
thw19850316 2007-04-10
  • 打赏
  • 举报
回复
帮帮忙啊!
guyehanxinlei 2007-04-09
  • 打赏
  • 举报
回复
Option Explicit

Private Sub fg_BeforeMouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single, Cancel As Boolean)

' only interesetd in left button
If Button <> 1 Then Exit Sub

' get cell that was clicked
Dim r&, c&
r = fg.MouseRow
c = fg.MouseCol

' make sure the click was on the sheet
If r < 0 Or c < 0 Then Exit Sub

' make sure the click was on a cell with a button
If Not (fg.Cell(flexcpPicture, r, c) Is imgBtnUp) Then Exit Sub

' make sure the click was on the button (not just on the cell)
' note: this works for right-aligned buttons
Dim d!
d = fg.Cell(flexcpLeft, r, c) + fg.Cell(flexcpWidth, r, c) - X
If d > imgBtnDn.Width Then Exit Sub

' click was on a button: do the work
fg.Cell(flexcpPicture, r, c) = imgBtnDn
MsgBox "Thanks for clicking my custom button!"
fg.Cell(flexcpPicture, r, c) = imgBtnUp

' cancel default processing
' note: this is not strictly necessary in this case, because
' the dialog box already stole the focus etc, but let's be safe.
Cancel = True

End Sub

Private Sub Form_Load()

' initialize grid
fg.Editable = flexEDKbdMouse
fg.AllowUserResizing = flexResizeBoth

' add some buttons to the grid
Dim i%
For i = 2 To 6
fg.Cell(flexcpPicture, i, 2) = imgBtnUp
fg.Cell(flexcpPictureAlignment, i, 2) = flexAlignRightCenter
Next

End Sub

Private Sub Form_Resize()
On Error Resume Next
fg.Move fg.Left, fg.Top, ScaleWidth - 2 * fg.Left, ScaleHeight - fg.Left - fg.Top
End Sub
thw19850316 2007-04-09
  • 打赏
  • 举报
回复
VSFlexGrid我只知道做复选筐的,把cellDataType设置成boolean就行了,其他的不知道,
guyehanxinlei(孤夜寒心泪)
指点指点
guyehanxinlei 2007-04-09
  • 打赏
  • 举报
回复
VSFlexGrid可以做到
skysyan 2007-04-09
  • 打赏
  • 举报
回复
你是要将所有的行实现哪样的效果还是当鼠标单击或双击的时候实现哪个效果呢,
白发程序猿 2007-04-09
  • 打赏
  • 举报
回复
LZ的想法是好
可做不到
thw19850316 2007-04-09
  • 打赏
  • 举报
回复
有没有其他不要注册的控件可以用?
chuifengde 2007-04-09
  • 打赏
  • 举报
回复

7,763

社区成员

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

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