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

[µo°Ý] ¬Û¦P¤¸¥óªº¨Æ¥ó°}¦C

[µo°Ý] ¬Û¦P¤¸¥óªº¨Æ¥ó°}¦C

Hello, ¦U¦ì¤j¤j

°²³]¦³¤@UserForm ¸Ì, ¦³50­ÓªºCheckBox01 , CheckBox02 , CheckBox03 , ....... , CheckBox50 ¤¸¥ó,
¦Ó¨C¤@­ÓCheckBox«h¬O±±ºÞ¥t¤@TextBox »PComboBoxªº[Enable] or [Disable].
§Y¨Ò¦pIJµo¬Y¤@­ÓCheckBox03_Click()¨Æ¥ó«á, TextBox03.Enabled=CheckBox03.Value , ComboBox03.Enabled=CheckBox03.Value
¤p§Ì¥Ø«eªº¼gªk¥u¯à¤gªk½m¿ûªº¤è¦¡, ±N¨C¤@­ÓCheckBoxªºClick¨Æ¥ó°Ê§@, ­«½Æ50¦¸, ¯Ó®É¯Ó¤O, ¥BºûÅ@¤£©ö,

         Private Sub CheckBox03_Click()
                       TextBox03.Enabled=CheckBox03.Value
                       ComboBox03.Enabled=CheckBox03.Value
         End Sub

¬G·Q½Ð±Ð¦U¦ì¤j¤j­Ì, ¥i¨Ì°}¦Cªº¤è¦¡¨Ó°µClick¨Æ¥óªº¼¶¼g ?

Thanks ~
·s¤â¤W¸ô¡A½Ð¦h¥]²[¡C

Hello, ¦U¦ì¤j¤j

½Ð°Ý³o¤¸¥óªº¨Æ¥ó¥i§_¨Ì°}¦C¤è¦¡Ä²µo?
ÁÙ¬O»Ý¥u¦³¤gªk½m¿ûªº¤èªk¦Ó¤w?!
Thanks ~
·s¤â¤W¸ô¡A½Ð¦h¥]²[¡C

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2019-7-24 23:07 ½s¿è

¦ý¦pªG§A¥u¬O­n checkbox ¦³¨Æ¥ó
¤£¥Î¨º»ò³Â·Ð¥h¥Î checkbox

http://forum.twbts.com/viewthread.php?tid=20889

TOP

Hello, Jackq

¦¹ÃþClass¤è¦¡, §Ú¤]¦³¦b»Åª¯¤j¯«¨º¨à«ôŪ¨ì...^_^...
¦³Ãª¤½¥q¦³ÀÉ®×­­¨î, ¬G¥u¯à°µTrial Runµ{¦¡ªº¤ß±o¤À¨É....

ÁÂÁ±zªº¤À¨É»P«ü¾É...

==> ½d¦C: 5­Ó CheckBox , ComboBox  &  TextBox ªºVisible Function Åã¥Ü.

==> UserForm1 µ{¦¡¬q ::
Option Explicit

Dim ComboClass(4) As New Class1
Dim TextClass(4) As New Class1
Dim CheckClass(4) As New Class1

Private Sub UserForm_Initialize()
              Dim aaaarray() As Variant
              Dim ag As Integer

               aaaarray = Array(ComboBox1, ComboBox2, ComboBox3, ComboBox4, ComboBox5)

               For ag = 0 To 4 Step 1
                      aaaarray(ag).Clear
                      aaaarray(ag).AddItem "a"
                      aaaarray(ag).AddItem "b"
                      aaaarray(ag).AddItem "c"
                      aaaarray(ag).AddItem "d"
   
                      Set ComboClass(ag).ComboBoxArray = Userform1.Controls("ComboBox" & ag + 1)
                      Set TextClass(ag).TextBoxArray = Userform1.Controls("TextBox" & ag + 1)
                      Set CheckClass(ag).CheckBoxArray = Userform1.Controls("CheckBox" & ag + 1)
   
                Next ag

End Sub


==> Class1 µ{¦¡¬q ::
Option Explicit

Public WithEvents ComboBoxArray As MSForms.ComboBox
Public WithEvents TextBoxArray As MSForms.TextBox
Public WithEvents CheckBoxArray As MSForms.CheckBox

Public Sub ComboBoxArray_Change()
            MsgBox ComboBoxArray.Name
End Sub

Public Sub TextBoxArray_Click()
            MsgBox TextBoxArray.Name
End Sub

Public Sub CheckBoxArray_Click()
  
            Userform1.Controls("ComboBox" & Right(CheckBoxArray.Name, 1)).Visible = CheckBoxArray.Value
            Userform1.Controls("TextBox" & Right(CheckBoxArray.Name, 1)).Visible = CheckBoxArray.Value

End Sub
·s¤â¤W¸ô¡A½Ð¦h¥]²[¡C

TOP

        ÀR«ä¦Û¦b : ¬°¤H³B¥@­n¤p¤ß²Ó¤ß¡A¦ý¤£­n¡u¤p¤ß²´¡v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD