自定义按钮控件修改增加一个功能
向各位老师们求救,想给自定义按钮增加一个功能,拜托各位大哥哥帮忙,好吗,谢谢
程序代码: '****************************
'如果状态BS_Point 或 BS_Pres时,鼠标在按钮上,显示关闭图片
'***************************
Dim lpPoint As POINT_API
If mState = BS_Point Or mState = BS_Press Then
GetCursorPos lpPoint
ScreenToClient .hwnd, lpPoint
If lpPoint.X < .ScaleLeft + .ScaleWidth - Image1(0).Width Or lpPoint.X > .ScaleLeft + .ScaleWidth Or _
lpPoint.Y < .ScaleTop Or lpPoint.Y > .ScaleTop + Image1(0).Height Then
'显示关闭按钮
.PaintPicture Image1(1), .ScaleLeft + .ScaleWidth - Image1(0).Width - 2, 2
Else
.PaintPicture Image1(0), .ScaleLeft + .ScaleWidth - Image1(0).Width - 2, 2
End If
End If
程序代码:
'鼠标移动时变动关闭按钮图标
If X < .ScaleLeft + .ScaleWidth - Image1(0).Width Or X > .ScaleLeft + .ScaleWidth Or _
Y < .ScaleTop Or Y > .ScaleTop + Image1(0).Height Then
'显示关闭按钮
.PaintPicture Image1(1), .ScaleLeft + .ScaleWidth - Image1(0).Width - 2, 2
Else
.PaintPicture Image1(0), .ScaleLeft + .ScaleWidth - Image1(0).Width - 2, 2
End If

