Skip to main content

AccessTr.neT


Kontrol Eklemek

Kontrol Eklemek

#7
Private Sub CommandButton1_Click()
 Dim cCont As Control
 Dim strControl As String
 
 If ComboBox1.ListIndex > -1 Then
  strControl = "Forms." & ComboBox1 & ".1"
 End If
 
 Set cCont = Me.Controls.Add _
        (strControl, "CopyOf")

 
End Sub
 

Private Sub UserForm_Initialize()
With ComboBox1
        .AddItem "CheckBox"
        .AddItem "CommandButton"
        .AddItem "TextBox"
        .AddItem "ToggleButton"
    End With
End Sub
Cevapla
#8
Private Sub CommandButton1_Click()
 Dim cCont As Control
 
Set cCont = Me.Controls.Add _
        ("Forms.CommandButton.1", "CopyOf")
       
    With cCont
        .Caption = "Thanks for creating me"
        .AutoSize = True
    End With
   
End Sub
Cevapla
#9
Merhaba, bu yazdıklarınız örnek mi, soru mu?
Cevapla
#10
Örnek kodlar
bazılarını anladım bazılarını anlamadım ama belki benden daha iyi anlayan birisi vardır diye ekledim
Cevapla
#11
(12/01/2020, 08:25)accessman yazdı: Private Sub CommandButton1_Click()
 Dim cCont As Control
 
Set cCont = Me.Controls.Add _
        ("Forms.CommandButton.1", "CopyOf")
       
    With cCont
        .Caption = "Thanks for creating me"
        .AutoSize = True
    End With
   
End Sub

CopyOf adında bir Button ekleniyor kod ile.
Ve görünür adıda Thanks for creating me
Cevapla
#12
Gifteki gibi.

[Resim: nUu7Fcj1.gif]
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da
Task