DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Public MyPass ' Bu satir Modulün General_Declarations kisminda olucak (en üstte).
'
Sub MainProgram()
'
'Ana programin kodlari buralarda
'
'
'Asagidaki satirla "*" karakterli sifre girme kutusunu çagiriyoruz
'
MyPasswBox
'
'Eger kullanici bir sifre girdiyse,
'asagidaki satirlarda, kullanicinin girdigi sifreyi
'"çiplak" olarak görüntülüyoruz.
'
'Sizin yapmaniz gereken If - End If satirlari arasinda
'sifre kontrolunu yaptirip, kodlari çalismaniza göre yönlendirmek olucak
If MyPass <> "" Then
MsgBox "Girilen sifre : " & MyPass
End If
'
'Ana programin kodlarinin devami buralarda
'
End Sub
'
Sub MyPasswBox()
Dim PassWForm
Set PassWForm = ThisWorkbook.VBProject.VBComponents.Add(3)
PassWForm.properties("Width") = 200
PassWForm.properties("Height") = 90
Set NewTextBox = PassWForm.Designer.Controls.Add("forms.TextBox.1")
PassWForm.properties("Caption") = "Sifre girisi !"
With NewTextBox
.Width = 120
.Height = 18
.Left = 8
.Top = 20
.PasswordChar = "*"
.ForeColor = vbRed
End With
Set NewCommandButton1 = PassWForm.Designer.Controls.Add("forms.CommandButton.1")
With NewCommandButton1
.Caption = "Vazgeç"
.Height = 18
.Width = 50
.Left = 140
.Top = 18
End With
Set NewCommandButton2 = PassWForm.Designer.Controls.Add("forms.CommandButton.1")
With NewCommandButton2
.Caption = "Tamam"
.Height = 18
.Width = 50
.Left = 140
.Top = 42
End With
With PassWForm.CodeModule
X = .CountOfLines
.InsertLines X + 1, "Sub CommandButton1_Click()"
.InsertLines X + 2, "Unload Me"
.InsertLines X + 3, "End Sub"
.InsertLines X + 4, "Sub CommandButton2_Click()"
.InsertLines X + 5, "MyPass = TextBox1"
.InsertLines X + 6, "Unload Me"
.InsertLines X + 7, "End Sub"
.InsertLines X + 8, "Sub UserForm_Activate()"
.InsertLines X + 9, "Me.SpecialEffect=3"
.InsertLines X + 10, "End Sub"
End With
VBA.UserForms.Add(PassWForm.Name).Show
ThisWorkbook.VBProject.VBComponents.Remove VBComponent:=PassWForm
End Sub