本来我是想鼠标不放到计算按纽上去的时候是蓝色的,就想上面的图,鼠标放到计算按纽上去的时候是红色的,鼠标单击计算按纽上去的时候是绿色的。 但是现在一打程序计算按纽(鼠标不放到计算按纽上去的时候)是蓝色的,鼠标放上去后计算按纽就变红色的了,按道理讲鼠标现在放下来,计算按纽会变成蓝色,但是现在还是红色! 你们看看我的原代码,是什么地方错了!~~~ ===================================================================== Option Explicit
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _ (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _ ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long Private Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringA" _ (ByVal dwError As Long, _ ByVal lpstrBuffer As String, _ ByVal uLength As Long) As Long
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" _ (ByVal lpszLongPath As String, ByVal lpszShortPath As String, _ ByVal cchBuffer As Long) As Long
'This is for the button rollovers Dim MouseOver Dim MousePress Dim NewIndex 'This is for playing the wave files
Dim MouseOverSound As String Dim MousePressSound As String Dim MouseUpSound As String Private Sub ButtonPictur1_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single) ButtonPictur1.Picture = Image6.Picture Dim k As Single k = Val(Text1.Text) Text2.Text = k * k End Sub
Private Sub ButtonPictur1_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single) ButtonPictur1.Picture = Image5.Picture End Sub
Private Sub ButtonPictur1_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single) ButtonPictur1.Picture = Image4.Picture End Sub
Private Sub ButtonPictur2_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single) ButtonPictur2.Picture = Image9.Picture End End Sub
Private Sub ButtonPictur2_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single) ButtonPictur2.Picture = Image7.Picture End Sub
Private Sub ButtonPictur2_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single) ButtonPictur2.Picture = Image8.Picture End Sub
Private Sub Form_Load() ButtonPictur1.Picture = Image5.Picture ButtonPictur2.Picture = Image7.Picture End Sub