我是用很多的image做成很多按鈕,每個image都有滑鼠游標圖,當我按下其中的一個image的時候,其它的image按鈕都不能按(enabled等於false),但是我要問的是當其它的image按鈕不能按的時候,我的滑鼠移到其它不能按的image按鈕上面,我又要把它的滑鼠游標圖,變成另外一個圖,要怎麼在程式上做呢?
請各位大大幫我解答,謝謝各位大大!!
2006-04-14 07:16:47 · 1 個解答 · 發問者 ~~呆呆地玉~~ 3 in 電腦與網際網路 ➔ 程式設計
'假設您有3個Image陣列:Image1(0)~Image1(2)Private Type RECT '自訂1個類型(記錄座標) L As Long T As Long R As Long B As LongEnd TypeDim A(2) As RECTPrivate Sub Form_Load()Dim I%'先記錄每個Image的座標For I = 0 To 2 With Image1(I) A(I).L = .Left: A(I).T = .Top A(I).R = .Left + .Width: A(I).B = .Top + .Height End WithNextEnd SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Dim I%For I = 0 To 2 With A(I) '判斷滑鼠是否位於Image1(I)的範圍,是的話 If X >= .L And X <= .R And Y >= .T And Y <= .B Then '若還沒改成Image1(I)的圖示時就改成Image1(I)的圖示 If MousePointer <> 99 Then MouseIcon = Image1(I).MouseIcon MousePointer = 99 End If Exit For Else '否的話,改成預設的滑鼠指標 If MousePointer <> 0 Then MousePointer = 0 End If End WithNextEnd Sub
2006-04-14 08:29:43 · answer #1 · answered by W.J.S. 7 · 0⤊ 0⤋