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

[µo°Ý] ¦p¦ó§PÂ_§Ú­è©Ò¥´¤ÄªºCheckBox

¦p¦ó½Æ»sUserForm

§Ú·Q±NUserForm1½Æ»s¨ìUserForm2

TOP

¦^´_ 9# av8d

7# ¬O UserForm1 ªºµ{¦¡½X
¦³³\¦h UserForm ¨º¦b¨C¤@UserForm µ{¦¡½X¤¤ ¨Ì¼Ëµe¸¬Äª¼g¤U¥¦¦Û¤vªºµ{¦¡½X

TOP

¦^´_ 7# GBKEE


    ½Ð°Ý¦pªG­n©Ò¦³UserForm~¬O§_¥u¯à¦bUserForm1¤U·s¼WUserForm2 ? ÁÙ¬O¯à¤@¦¸«Å§i¥þ³¡UserForm ?

TOP

¦^´_ 7# GBKEE


    ·PÁ¦U¦ì¦Ñ®v¦b»ä­·¤Ñ¨S©ñ°²ÁÙ¨ÓÀ°¦£~¦¹µª®×Åý§Ú¾Ç²ß¤Fª«¥óÃþ§O¼Ò²Õ~

TOP

¦^´_ 5# av8d
§Ú¦b4# ¦³¼g¬O 2# oobird  ªþÀÉ ª«¥óÃþ§O¼Ò²Õ
ª«¥óÃþ§O¼Ò²Õ cControlArray µ{§Ç ¦p¤U
  1. Option Explicit
  2. Public WithEvents CheckboxGroup As MSForms.CheckBox
  3. Private Sub CheckboxGroup_Click()
  4.     UserForm1.xlText = CheckboxGroup.Caption
  5. End Sub
½Æ»s¥N½X
UserForm1 ªºµ{¦¡½X
  1. Public xlText As String
  2. Private Sub CommandButton1_Click()
  3.    '»¡©ú UserForm1¤¤ CommednBurron µ{¦¡
  4.    UserForm1.TextBox1 = UserForm1.xlText
  5. End Sub
  6. Private Sub UserForm_Initialize()
  7. Dim cCBs As Integer
  8. Dim ctl As Control
  9.    cCBs = 0
  10.    For Each ctl In Me.Controls
  11.        If TypeName(ctl) = "CheckBox" Then
  12.            cCBs = cCBs + 1
  13.            ReDim Preserve aryCBs(1 To cCBs)
  14.            Set aryCBs(cCBs).CheckboxGroup = ctl
  15.        End If
  16.    Next ctl
  17. End Sub
½Æ»s¥N½X
§Ú¤§©Ò¥H¤£ª½±µ¤W¶ÇÀÉ®× ¬O§Æ±æ¦U¦ì¦h½m²ß¤~·|¶i¨Bªº

TOP

¦^´_ 5# av8d

µy·L¤F¸Ñ¤@¤Uª«¥óÃþ§Oªº¬yµ{
class_CheckBox.rar (15.09 KB)
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# GBKEE


    G¤j§Úªº·N«ä¬O~§Ú¦³10­ÓCheckBox
§Ú§Æ±æ§ÚÂI¤@¤UCommednBurron«á
±N§Ú³Ì«á¤@­ÓÂI¤UªºCheckBox.Caption & CommednBurron.Captionªº­È¥áµ¹TextBox1

¦A¦¸·PÁÂG¤j¦b»ä­·¤Ñ¸Ì©âªÅÀ°§U~ÁÂÁ±z!

­è´ú¸Õ¤F¤@¤U~¤èªk2·|¥X²{¿ù»~~§Ú±NÀɮפW¶Ç¦p¤U

class_CheckBox.rar (12.23 KB)

TOP

¦^´_ 3# av8d
2# oobird  ªþÀÉ ª«¥óÃþ§O¼Ò²Õ
  1. Option Explicit
  2. Public WithEvents CheckboxGroup As MSForms.CheckBox
  3. Private Sub CheckboxGroup_Click()
  4.    '-------¤èªk1  ª½±µµ¹¥¦
  5.    UserForm1.TextBox1 = CheckboxGroup.Caption
  6.    
  7.    '-------¤èªk2 ÂI¤@¤UCommednBurron
  8.    '»¡©ú UserForm1¼Ò²Õ »Ý Public xlText as  String
  9.      UserForm1.xlText = CheckboxGroup.Caption
  10.    '»¡©ú UserForm1¤¤ CommednBurron µ{¦¡-> UserForm1.TextBox1 = UserForm1.xlText
  11.    
  12.    'MsgBox "You Click " & CheckboxGroup.Caption & vbNewLine & _
  13.     "Value is " & CheckboxGroup.Value
  14. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# oobird


        ¤j¤j~§Úªº·N«ä¬O~§Ú¦³10­ÓCheckBox
§Ú§Æ±æ§ÚÂI¤@¤UCommednBurron«á±N§Ú³Ì«á¤@­ÓÂI¤UªºCheckBox.Captionªº­È¥áµ¹TextBox1

TOP

ªþ¥ó¥Ü¨Ò
class_CheckBox.rar (10.13 KB)

TOP

        ÀR«ä¦Û¦b : ¬O«D·í±Ð¨|¡AÆg¬ü§@ĵ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD