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

[µo°Ý] ©óª«¥óÃþ§O¼Ò²Õ¦p¦ó¨D±o¸ÓComboBox¤§(Name)?

[µo°Ý] ©óª«¥óÃþ§O¼Ò²Õ¦p¦ó¨D±o¸ÓComboBox¤§(Name)?

½Ð±Ð¤j¤j:
Dim newcontrol() As New Class1
Private Sub UserForm_Initialize()
    ReDim newcontrol(1 To 10)
    For i = 1 To 10
        Set newcontrol(i).Comd = Controls("ComboBox" & i)
    Next
End Sub
Public WithEvents Comd As MSForms.ComboBox
Private Sub Comd_Change()
    ?¦p¦ó¥i±oª¾ ¸ÓComd¬O«ö¤F­þ¤@­Ó"ComboBox" & n
   ¤]´N¬O n ¦p¦ó¨D±o?

End Sub

¦bª«¥óÃþ§O¼Ò²Õclass1
Public WithEvents Comd As MSForms.ComboBox
Private Sub Comd_Change()
    ?¦p¦ó¥i±oª¾ ¸ÓComd¬O«ö¤F­þ¤@­Ó"ComboBox" & n
   ¤]´N¬O n ¦p¦ó¨D±o?
End Sub
¥D­n¬O­Y«ö¤Fcombobox3®É­n¾Þ§@combobox4¤§³]©w
­Y«ö¤Fcombobox5®É­n¾Þ§@combobox6¤§³]©w
­Y«ö¤Fcombobox7®É­n¾Þ§@combobox8..............¤Ó¦h¤F
¦]¦¹¤~»Ý­n¥Î¨ì ª«¥óÃþ§O
·q½Ð½Ñ¦ì¤j¤j¨ó§U
ÁÂÁÂ

TOP

¦^´_ 2# yangjie
ª½±µµ¹.Name
  1. Private Sub Comd_Change()
  2.   Select Case Comd.Name
  3.     Case "ComboBox1"
  4.        MsgBox "aaa"
  5.        '????
  6.     Case "ComboBox2"
  7.         '????
  8.     Case Else
  9.         '????
  10.     End Select
  11. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 3# GBKEE

ÁÂÁ GBKEEª©¤j:
­ì¥H¬°Public WithEvents Comd As MSForms.ComboBox
    Comd¨S¦³Name¤§ÄÝ©Ê
­è­è´ú¸Õ ¤@¤ÁOK    ÁÂÁÂ

TOP

        ÀR«ä¦Û¦b : ¯à·F¤£·F¡A¤£¦p­W·F¹ê·F¡C
ªð¦^¦Cªí ¤W¤@¥DÃD