不错。我是加了个TEXTBOX,而且还在同一网格的右边加入一个COMMANDBUTTON,我希望用户在改变列宽以后,COMMANDBUTTON可以靠右对齐。
解决方案 »
- 如何改变窗口的系统滚动条宽度,或是说把它隐藏起来
- matlab的一个m文件中是否可以编写多个互不调用、地位平行的函数,其中每个函数可独立的被外部调用。就像vb中的.bas模块一样,里面放好多个函数,各个函数之间彼此独立可以无任何关系。
- dll注册问题
- 这个问题确实解决不了了 请大家帮帮我
- XML相关!
- 急,关于excel的问题
- VB爱好者的交流天地,MSN,QQ汇总方便开发软件时交流.
- API调用中的常数设置问题
- 大家来瞧瞧!! Help me! 程序或许简单 也许你也不知道
- 用修改注册表的方法把外加程序加到IE的工具栏上,怎样确定Extensions键下那个值?
- 如何显示一个对象的全部属性?
- 我的最后分,有没有最新版的msdn下载速度要快一点的最好有100k/s
然后在MSHFlexGrid1的mousedown事件中判断鼠标是否点在列与列的分隔线上
如果是设置一个全局的标志,这个标志需要包含具体是那条分隔线的信息,
然后你在mousemove里改变列宽
在mouseup中把那个全局标志置回初始状态
你有没有代码?
你有耐心就自己查msdn
或者你可以找ljren_t(立志),记得我在论坛上看到的例子是由他提供的
Private Sub VSFlexGrid1_AfterUserResize(ByVal Row As Long, ByVal Col As Long)End Sub
这样的事件啊......
Option ExplicitPrivate Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function GetCapture Lib "user32" () As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Type POINTAPI
x As Long
y As Long
End Type
Private blnMouseIsIn As BooleanPrivate Sub cursorManager(x As Single, y As Single)
Dim pointXY As POINTAPI
Dim hWnd As Long
Call GetCursorPos(pointXY)
hWnd = WindowFromPoint(pointXY.x, pointXY.y)
If (x > 0) And (x < Me.Width) And (y > 0) And (y < Me.Height) And (Me.hWnd = hWnd) Then
If Not blnMouseIsIn Then
blnMouseIsIn = True
Debug.Print "In"
End If
If GetCapture <> Me.hWnd Then
SetCapture Me.hWnd
End If
Else
If blnMouseIsIn Then
Debug.Print "out"
ReleaseCapture
End If
blnMouseIsIn = False
End If
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Call cursorManager(x, y)
End Sub
'Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
'Call cursorManager(x, y)
'End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Call cursorManager(x, y)
End Sub