虽然过程很难,但是通过努力自己成功了,心里很happy。体会到了编程的乐趣,以后继续努力学好VB。
过程如下:
Private Sub Command1_Click()
Dim M As Integer
Dim N As Integer
M = Int(Val(Text1.Text))
N = Int(Val(Text2.Text))
Dim Temparyvalue As Integer
If M < N Then
Temparyvalue = M
M = N
N = Temparyvalue
End If
Dim Remainder As Integer
Remainder = M Mod N
While Remainder <> 0
M = N
N = Remainder
Remainder = M Mod N
Wend
Label4 Caption = Str(N)
End Sub