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

µ{¦¡°õ¦æ«á¥X²{Label¨S¦³³]©wª«ÅܼƩÎWith°Ï¶ôÅܼÆ

µ{¦¡°õ¦æ«á¥X²{Label¨S¦³³]©wª«ÅܼƩÎWith°Ï¶ôÅܼÆ

¦U¦ì¤j¤j¦n¡G
txtK1.rar (14.02 KB)
  ¤p§Ì·Q¤Þ¥Î¤U¦C»yªk¡A¦ý°õ¦æ¤§«á·|¥X²{
Label¨S¦³³]©wª«ÅܼƩÎWith°Ï¶ôÅܼơC
Textbox­ÈµLªk¹ïÀ³¨ìLabel.Caption¤º¡C
½Ð°Ý­ì¦]¬°¦ó¤SÀ³¦p¦ó­×§ï¥¿½T»yªk©O¡H

»yªk¦p¤U¡G

Private WithEvents myTb As MSForms.TextBox
Private WithEvents myLab As MSForms.Label
Private myCktype1 As Long
Private myCktype2 As Long
Public Property Set tb(setTb As MSForms.TextBox)

    Set myTb = setTb
   
End Property
Public Property Get tb() As MSForms.TextBox

End Property
Public Property Let ck1(setCk1 As Long)
   
    myCktype1 = setCk1
   
End Property
Public Property Set lb(setLb As MSForms.Label)
   
    Set myLab = setLb
   
End Property
Public Property Let ck2(setCk2 As Long)
   
    myCktype2 = setCk2
   
End Property
Private Sub myTb_Change()
   
   myTb.Text = UCase(myTb)
   Select Case myCktype1
   
   Case 1        
        'UserForm1.Label1.Caption = myTb.Text
        myLab.Caption = myTb.Text          '¬°¦ó·|¥X²{¨S¦³³]©wª«ÅܼƩÎWith°Ï¶ôÅܼƩO¡H        
   Case 2   
        'UserForm1.Label2.Caption = myTb.Text
        myLab.Caption = myTb.Text
   Case 3
        
        'UserForm1.Label3.Caption = myTb.Text
        myLab.Caption = myTb.Text        
   End Select            
End Sub

Private Sub UserForm_Initialize()
        
    Dim i As Long
    ReDim myTb(1 To 3)
    For i = 1 To 3
        Set myTb(i) = New mTxtClass
        Set myTb(i).tb = Me.Controls("Textbox" & CStr(i))
    Next
   
    myTb(1).ck1 = 1
    myTb(2).ck1 = 2
    myTb(3).ck1 = 3
   
    ReDim myLab(1 To 3)
    For i = 1 To 3
        Set myLab(i) = New mTxtClass
        Set myLab(i).lb = Me.Controls("Label" & CStr(i))
    Next
   
    myLab(1).ck2 = 1
    myLab(2).ck2 = 2
    myLab(3).ck2 = 3      
End Sub

ÁÂÁ¦U¦ì¤j¤j¡I

¸É¥R»¡©ú¡G
ªí³æ¤W¦³¤T­ÓTextboxª«¥ó
Textbox1¿é¤J¦r¦ê®É¡ALabel1·|
Åã¥ÜTextbox1ªº¦r¦ê
¨ä¥¦¹p¦P

TOP

¦^´_ 1# dechiuan999


    ¸Õ¸Õ­×§ï¤@¤Uªí³æ³¡¥÷:
  1. Dim myControl() As mTxtClass

  2. Private Sub UserForm_Initialize()


  3.     Dim i As Long
  4.     ReDim myControl(1 To 3)
  5.     For i = 1 To 3
  6.         Set myControl(i) = New mTxtClass
  7.         Set myControl(i).tb = Me.Controls("Textbox" & CStr(i))
  8.         Set myControl(i).lb = Me.Controls("Label" & CStr(i))
  9.     Next
  10.    
  11.     myControl(1).ck1 = 1
  12.     myControl(2).ck1 = 2
  13.     myControl(3).ck1 = 3
  14.    
  15.    
  16. End Sub
½Æ»s¥N½X
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

¦^´_ 3# kimbal


    ª©¥D¤j¤j±z¦n¡G

   ¤p§Ì¨Ìª©¥D¤j¤j´£¨Ñ
­×¥¿¤§»yªk¡A¤w´ú¸Õ¦¨¥\¡C

  ¤p§Ì¹ïª«¥óÃþ§OÁÙ¬O²z¤£¥XÀYºü¡A
¥u¯à¦h¦V«e½ú½Ð¯q¤ÎÃ@µ¦¦Û¤w¦h¥[½m²ß¡C

´N·P®¦¡I

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD