ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ToggleButton«ö¶s

[µo°Ý] ToggleButton«ö¶s

³]­p¤@­ÓToggleButton1©ñ¦b¤u§@ªí1¡A§Æ±æ¥h±±¨îuserform1ªº¶}±Ò©ÎÃö³¬
µ{¦¡½X¦pªþ¥ó
¦ý¬O¦ü¥G¥u¯à¶}¡A«oµLªkÃö

¦Ó¥B¶}¤F¤§«á¡A­YÂIÀ»userform1¥k¤W¨¤ªºÃö³¬«ö¶s¡AToggleButton1«ö¶s´N°»´ú¤£¨ì¡A´NÅܱo«ÜÀª§¼

CODE.zip (320 Bytes)

¦^´_ 1# ssooi
§A·Q­nªºµ²ªG¬O©³¤U³o¼Ë¶Ü?
===== UserForm1 =====
  1. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
  2.     With ActiveSheet
  3.       .ToggleButton1.Caption = " OFF "
  4.       .ToggleButton1.BackColor = RGB(248, 250, 250)
  5.     End With
  6.     Cancel = True
  7.     UserForm1.Hide
  8. End Sub
½Æ»s¥N½X
===== ¤u§@ªí1 =====
  1. Private Sub ToggleButton1_Click()
  2.   If ToggleButton1.Caption = " ON " Then
  3.     ToggleButton1.Caption = " OFF "
  4.     ToggleButton1.BackColor = RGB(248, 250, 250)
  5.     UserForm1.Hide
  6.   Else
  7.     ToggleButton1.Caption = " ON "
  8.     ToggleButton1.BackColor = RGB(0, 255, 0)
  9.     UserForm1.Show
  10.   End If
  11. End Sub
½Æ»s¥N½X
¤Á´«Åã¥ÜUserForm-ans.zip (18.3 KB)

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD