这些是我看到的,希望对你有帮助,是个user object /////////////// boolean ib_Captured public string down_picturename ////////////////// function ulong SetCapture(ulong hwnd) library "user32.dll" function boolean ReleaseCapture() library "user32.dll" ////////// ///当触发clicked后还复为clicked 以前状态string picture_name picture_name = this.picturenameif not ib_Captured then SetCapture(handle(this)) ib_Captured=true this.picturename= this.down_picturename this.down_picturename = picture_name else ib_Captured = false ReleaseCapture() this.picturename= this.down_picturename this.down_picturename = picture_name end if ////////////////////////////// string picture_name picture_name = this.picturename if not ib_Captured then SetCapture(handle(this)) ib_Captured=true this.picturename= this.down_picturename this.down_picturename = picture_nameelse /////判断指针是否出界 if (XPos<0 or YPos<0) or (XPos>=this.Width or YPos>this.Height) then ib_Captured = false ReleaseCapture() this.picturename= this.down_picturename this.down_picturename = picture_name end if end if return 1
///////////////
boolean ib_Captured
public string down_picturename
//////////////////
function ulong SetCapture(ulong hwnd) library "user32.dll"
function boolean ReleaseCapture() library "user32.dll"
//////////
///当触发clicked后还复为clicked 以前状态string picture_name
picture_name = this.picturenameif not ib_Captured then
SetCapture(handle(this))
ib_Captured=true
this.picturename= this.down_picturename
this.down_picturename = picture_name
else
ib_Captured = false
ReleaseCapture()
this.picturename= this.down_picturename
this.down_picturename = picture_name
end if
//////////////////////////////
string picture_name
picture_name = this.picturename
if not ib_Captured then
SetCapture(handle(this))
ib_Captured=true
this.picturename= this.down_picturename
this.down_picturename = picture_nameelse
/////判断指针是否出界
if (XPos<0 or YPos<0) or (XPos>=this.Width or YPos>this.Height) then
ib_Captured = false
ReleaseCapture()
this.picturename= this.down_picturename
this.down_picturename = picture_name
end if
end if
return 1
你用两个imagelist控件,分别载入你要的图标