DrawEdge(GetDC(handle(this))
lr_Border +++)
end if
return
//
// *** end lbuttondown event ***
// LButtonUp 事件代码
// *** begin lbuttonup event ***
//
rect lr_Border
if ib_MouseCaptured then
ib_MouseCaptured = FALSE
ReleaseCapture()
end if
if (XPos < or YPos < ) or (XPos >
thisWidth or YPos > thisHeight) then
in_State =
thisPictureName = is_PicNormal
else
in_State =
thisPictureName = is_PicHover
SetCapture(handle(this))
ib_MouseCaptured = TRUE
if not sb_SuppressHoverBorder then
lr_Borderleft =
lr_Bordertop =
lr_Borderright = UnitsToPixels
(thisWidth XUnitsToPixels!)
lr_Borderbottom = UnitsToPixels
(thisHeight YUnitsToPixels!)
DrawEdge(GetDC(handle(this))
lr_Border +++)
end if
end if
// 产生Clicked事件
thisevent post clicked()
return
//
// *** end lbuttonup event ***
// Other 事件代码
// *** begin other event ***
//
if messagenumber = and ib_MouseCaptured then
// wm_CaptureChanged
ib_MouseCaptured = FALSE
in_State =
thisPictureName = is_PicNormal
return
end if
return
//
// *** end other event ***
四简要说明
ib_MouseCaptured变量是作为MouseMove事件的刷新控件图片的信号灯及判断是否已安装了鼠标捕捉器
sb_SuppressHoverBorder变量默认值为FALSE当值为TRUE时控件不绘制凸或凹边框
Other事件当鼠标捕捉器被释放或被替换时会触发WM_CAPTURECHANGED事件例如您在Clicked事件中调用MessageBox函数时将触发WM_CAPTURECHANGED事件在此事件代码中恢复按钮到Normal状态
[] [] [] []