- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 256
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-26
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-3-22 08:10 ½s¿è
Calculater.rar (10.34 KB)
³o¬O³Ì°ò¦ªºª«¥óÃþ§OÀ³¥Îªº¼Ò«¬
¥i±q½d¨Ò¤¤¾Ç²ß¦p¦ó«Å§iª«¥óÃþ§O
±N¦PÃþª«¥ó¶°¦X°µ¦P¤@¨Æ¥ó
¥H²³æpºâ¾¹¬°¨Ò
USERFORM1¼Ò²Õ- Private Sub CommandButton19_Click() '=¸¹«ö¶s
- Dim Nr As Variant
- Nr = Application.Evaluate(Label1.Caption)
- Nr = IIf(IsError(Nr), Err.Number, Nr)
- If Label1.Caption <> "" Then Label2.Caption = CStr(Nr)
- End Sub
- Private Sub CommandButton20_Click() '¡ö¸¹«ö¶s
- If Label1.Caption <> "" Then Label1.Caption = Mid(Label1.Caption, 1, Len(Label1.Caption) - 1) '´î¤Ö¥kÃä1Ó¤å¦r
- End Sub
- Private Sub CommandButton21_Click()
- Unload Me '¨ø°£ªí³æ
- End Sub
- Private Sub UserForm_Initialize() 'ªí³æªì©l¨Æ¥ó
- For i = 1 To 18 '±N«eÓ«ö¶s¥[¤J°}¦C
- Set ctrl = Controls("CommandButton" & i)
- ReDim Preserve obj(i)
- Set obj(i).MyButton = ctrl
- Next
- End Sub
½Æ»s¥N½X Module1¼Ò²Õ- Public obj() As New Class1 '°}¦CÅܼƤº®e¬O·sªºª«¥óÃþ§O
½Æ»s¥N½X ª«¥óÃþ§O¼Ò²Õ CLASS1- Public WithEvents MyButton As MSForms.CommandButton '¦¹Ãþ§Oª«¥ó¬°ªí³æ«ö¶s
- Sub MyButton_Click() '¦¹Ãþ§O³æÀ»¨Æ¥ó
- Dim MyStr As String
- MyStr = UserForm1.Label1.Caption '¦r¦êÅܼƪºÈ¬Oªí³æ¼ÐÅÒ¤å¦r
- MyStr = MyStr & MyButton.Caption '¼W¥[¦r¦êÅܼƤº®e
- UserForm1.Label1.Caption = MyStr '±Nªí³æ¼ÐÅÒ¤å¦rÅܧó
- End Sub
½Æ»s¥N½X |
|