在vsflexgrid中怎么能够使某一列永远固定的成为按钮状态.希望各位大侠帮忙,肯定给分!
解决方案 »
- 控件里用到的组件都考过去了,为什么还是有error429?
- 怎样将时间的字符串转换成数字
- 請教一個簡單問題
- VB调用VC写的API,编译成EXE运行正常,在调试环境中却无法调用!
- 我在装VB6的时候,机器报错“MSVM注册失败,安装未完成“
- 在windows2000中是否存在自定义纸张?
- MSDN Library 中说明的怎么跟vb中不统一啊???为什么啊?
- 如何使一个BMP的图象旋转任意角度,能告诉我一个具体算法吗?
- 究竟有没有办法可以修改VB6编译的EXE文件?
- 各位大虾帮帮忙!
- 我用ADO编程访问远程服务器上的Oracle数据库,我的机器上是不是必须装Oracle客户端软件和网络工具吗
- 请问有谁用过超级兔子?
Object = "{1C0489F8-9EFD-423D-887A-315387F18C8F}#1.0#0"; "vsFlex8l.ocx"
Begin VB.Form Form1
Caption = "VSFlex7: Custom buttons (always visible)"
ClientHeight = 3645
ClientLeft = 2775
ClientTop = 1950
ClientWidth = 6585
Icon = "Form1.frx":0000
LinkTopic = "Form1"
ScaleHeight = 3645
ScaleWidth = 6585
Begin VSFlex8LCtl.VSFlexGrid fg
Height = 2595
Left = 60
TabIndex = 0
Top = 60
Width = 5655
_cx = 9975
_cy = 4577
_ConvInfo = 1
Appearance = 1
BorderStyle = 1
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MousePointer = 0
BackColor = -2147483643
ForeColor = -2147483640
BackColorFixed = -2147483633
ForeColorFixed = -2147483630
BackColorSel = -2147483635
ForeColorSel = -2147483634
BackColorBkg = -2147483636
BackColorAlternate= -2147483643
GridColor = -2147483633
GridColorFixed = -2147483632
TreeColor = -2147483632
FloodColor = 192
SheetBorder = -2147483642
FocusRect = 1
HighLight = 1
AllowSelection = -1 'True
AllowBigSelection= -1 'True
AllowUserResizing= 0
SelectionMode = 0
GridLines = 1
GridLinesFixed = 2
GridLineWidth = 1
Rows = 50
Cols = 10
FixedRows = 1
FixedCols = 1
RowHeightMin = 0
RowHeightMax = 0
ColWidthMin = 0
ColWidthMax = 0
ExtendLastCol = 0 'False
FormatString = ""
ScrollTrack = 0 'False
ScrollBars = 3
ScrollTips = 0 'False
MergeCells = 0
MergeCompare = 0
AutoResize = -1 'True
AutoSizeMode = 0
AutoSearch = 0
AutoSearchDelay = 2
MultiTotals = -1 'True
SubtotalPosition= 1
OutlineBar = 0
OutlineCol = 0
Ellipsis = 0
ExplorerBar = 0
PicturesOver = 0 'False
FillStyle = 0
RightToLeft = 0 'False
PictureType = 0
TabBehavior = 0
OwnerDraw = 0
Editable = 0
ShowComboButton = -1 'True
WordWrap = 0 'False
TextStyle = 0
TextStyleFixed = 0
OleDragMode = 0
OleDropMode = 0
ComboSearch = 3
AutoSizeMouse = -1 'True
FrozenRows = 0
FrozenCols = 0
AllowUserFreezing= 0
BackColorFrozen = 0
ForeColorFrozen = 0
WallPaperAlignment= 9
End
Begin VB.Image imgBtnDn
Height = 210
Left = 6060
Picture = "Form1.frx":0442
Top = 180
Visible = 0 'False
Width = 225
End
Begin VB.Image imgBtnUp
Height = 210
Left = 5700
Picture = "Form1.frx":056A
Top = 180
Visible = 0 'False
Width = 225
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option ExplicitPrivate 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 = TrueEnd SubPrivate 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 SubPrivate Sub Form_Resize()
On Error Resume Next
fg.Move fg.Left, fg.Top, ScaleWidth - 2 * fg.Left, ScaleHeight - fg.Left - fg.Top
End Sub
imgBtnUp 为按纽弹起时的图片
imgBtnDn 为按纽按下时的图片