Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Me.TextBox1.Text = Format(Date, "dd/mm/yyyy")
Me.TextBox1.ForeColor = vbBlue
custom_lock Me.TextBox1
Me.Label1.Caption = Format(Date, "dd/mm/yyyy")
Me.Label1.ForeColor = vbBlue
End Sub
Private Sub UserForm_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
custom_unlock Me.TextBox1
End Sub
Function custom_lock(tb As MSForms.TextBox)
tb.ForeColor = vbBlue
tb.Locked = True
End Function
Function custom_unlock(tb As MSForms.TextBox)
tb.ForeColor = vbBlack
tb.Locked = False
End Function