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

[µo°Ý] ComboBox ©M ToggleButton

[µo°Ý] ComboBox ©M ToggleButton

¥»©«³Ì«á¥Ñ jesscc ©ó 2011-10-1 00:42 ½s¿è

³Ìªñ½m²ß ComboBox ©M ToggleButton ³o¨âºØª«¥óªº¥Îªk¡A¸I¨ì¤@¨Ç°ÝÃDµLªk¸Ñ¨M

¥\¯à
ToggleButton1:
«ö¤U«á¡A¨ä¥L¨â­Ó ToggleButton ¦Û°Ê¼u°_¥¢®Ä¡AµM«á¤À§O¿ï¾Ü¨â­Ó ComboBox ªº­È¡A±µµÛ¦b®Ø½u½d³ò¤º¡AÂI¿ï¥ô·NÀx¦s®æ³£·|±N ComboBox1 & ComboBox2 ªº¤å¦r¶ñ¤JÀx¦s®æ¤¤

ToggleButton2:
«ö¤U«á¡A¨ä¥L¨â­Ó ToggleButton ¦Û°Ê¼u°_¥¢®Ä¡AµM«á¦b®Ø½u½d³ò¤º¡AÂI¿ï¥ô·NÀx¦s®æ¡A¶ñ¤J¶À©³±×½u®æ¦¡

ToggleButton3:
«ö¤U«á¡A¨ä¥L¨â­Ó ToggleButton ¦Û°Ê¼u°_¥¢®Ä¡AµM«á¦b®Ø½u½d³ò¤º¡AÂI¿ï¥ô·NÀx¦s®æ¡A¶ñ¤J¶À©³X½u®æ¦¡

"¥ô¤@ ToggleButton «ö¤U«á¡A¨ä¥L¨â­Ó ToggleButton ¦Û°Ê¼u°_¥¢®Ä" ³o­Ó¥\¯à¤@ª½¸Õ¤£¥X¨Ó¡A¦Ó¥Bµ{¦¡°õ¦æ¤£¥¿±`¡A¥i¥H±Ð±Ð§Ú¦p¦ó­×§ï¶Ü?

test1.rar (29.16 KB)
Jess

¦^´_ 1# jesscc
¥H¤Uµ{¦¡©ñ¦b "¤u§@ªí1"
  1. Private Sub ToggleButton1_Click()
  2.   If ToggleButton1 = True Then
  3.     ToggleButton2 = False
  4.     ToggleButton3 = False
  5.   End If
  6. End Sub

  7. Private Sub ToggleButton2_Click()
  8.   If ToggleButton2 = True Then
  9.     ToggleButton1 = False
  10.     ToggleButton3 = False
  11.   End If
  12. End Sub

  13. Private Sub ToggleButton3_Click()
  14.   If ToggleButton3 = True Then
  15.     ToggleButton1 = False
  16.     ToggleButton2 = False
  17.   End If
  18. End Sub

  19. Sub ComBoxInit()  ' ¥t¥~·s¼W¦¹³¡¥÷µ{¦¡, ComBox µ¹ªì­È, ¥u­n©ó¶}±ÒÀɮ׮ɰõ¦æ¤@¦¸§Y¥i
  20.   ComboBox1.List = Array("¹Ú", "¤K¼w", "¸q", "¥¨", "¼Ö", "¿}", "¤¤¿û", "·s¤H°V", "¹ê²ß", "¦Û­q")
  21.   ComboBox2.List = Array("9-17", "9-21", "9-2230", "10-22", "1030-22", "1030-2230", "11-17", "11-22", "11-2230", "12-17", "12-20", "12-22", "12-2230", "14-22", "14-2230", "18-22", "19-22", "¦Û­q")
  22. End Sub
½Æ»s¥N½X
¥H¤Uµ{¦¡©ñ¦b "ThisWorkBook"
  1. Private Sub Workbook_Open()
  2.   Call Sheets("¤u§@ªí1").ComBoxInit
  3. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# luhpro


   ÁÂÁ luhpro ¤j¡A°ò¥»¥\¯à¤w¸g¹F¨ì§Ú©Ò­nªº®ÄªG¤F¡C
¦Ü©ó Combobox ªì©l­Èªº³]©w¡A¦n¹³¨S¦³¤°»ò§@¥Î¡C
Jess

TOP

¦^´_  luhpro
ÁÂÁ luhpro ¤j¡A°ò¥»¥\¯à¤w¸g¹F¨ì§Ú©Ò­nªº®ÄªG¤F¡C
¦Ü©ó Combobox ªì©l­Èªº³]©w¡A ...
jesscc µoªí©ó 2011-10-1 22:14

À³¸Ó¨Ã¤£¬O¨S¤°»ò§@¥Î,
¥u­nÂI¶}¤U©Ô¦¡¿ï³æÀ³¸Ó´N·|¬Ý¨ì¥[¤Jªº¿ï¶µ¤º®e.
¤W­zµ{¦¡¦b¥[¤W¿ï¶µ¤º®e«á¨S¦³µ¹©w¦³¨q¤å¦rªºªì­È,
©Ò¥H¥¼¾Þ§@«e¬Ý°_¨Ó¨S¤º®e.
  1. Sub ComBoxInit()
  2.   With ComboBox1
  3.     .List = Array("¹Ú", "¤K¼w", "¸q", "¥¨", "¼Ö", "¿}", "¤¤¿û", "·s¤H°V", "¹ê²ß", "¦Û­q")
  4.     .Text = "¦Û­q"
  5.   End With
  6.   
  7.   With ComboBox2
  8.     .List = Array("9-17", "9-21", "9-2230", "10-22", "1030-22", "1030-2230", "11-17", "11-22", "11-2230", "12-17", "12-20", "12-22", "12-2230", "14-22", "14-2230", "18-22", "19-22", "¦Û­q")
  9.     .Text = "¦Û­q"
  10.   End With
  11. End Sub
½Æ»s¥N½X
³o¼Ë´N¦³ªì­È¤F.

¥t¥~, ¦]¬° ComboBox ªºªì©l¤Æ¬O¦b Workbook_Open ¤W°õ¦æ,
©Ò¥Hµ{¦¡²§°Ê«á¥²¶·¦A°õ¦æ¤@¦¸ Workbook_Open,
©Î¬OÃö³¬ Excel ÀÉ®×­«¶}«á·sªºµ{¦¡¤~¦³®Ä³á.

TOP

¦^´_ 3# jesscc
ÅýCombobox¨ú±oµJÂI®É³]¸m²M³æ¤º®e

Private Sub ComboBox1_GotFocus()
ComboBox1.List = Array("¹Ú", "¤K¼w", "¸q", "¥¨", "¼Ö", "¿}", "¤¤¿û", "·s¤H°V", "¹ê²ß", "¦Û­q")
End Sub


Private Sub ComboBox2_GotFocus()
ComboBox2.List = Array("9-17", "9-21", "9-2230", "10-22", "1030-22", "1030-2230", "11-17", "11-22", "11-2230", "12-17", "12-20", "12-22", "12-2230", "14-22", "14-2230", "18-22", "19-22", "¦Û­q")
End Sub
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¶â!¥i¥H¤F!
ÁÂÁ l ¤j©M H ¤jªº±Ð¾É!
Jess

TOP

ÁÂÁ¡Aºâ¬O¾Ç²ß¨ì¤F¡A¦ý¬O¦³­ÓºÃ°Ý¡A¦pªG¸ê®Æ«D±`ªº¦h¡A¨ºÀ³¸Ó¦p¦ó­×§ï?

TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD