-
I am trying to set up a button to that when you click it, it will clear the text in a certain textbox.
I tryed to motify a previous code but it didn't work:
Private Sub cleartext_Click()
If inputtext.SelText = "" Then
Clear.SetText inputtext
Else
Clear.SetText inputtext.SelText
End If
End Sub
But that didnt work, ;) but I took a shot...
Know whats wrong?
Thanks,
System
-
Try this:
Code:
Private Sub cleartext_Click()
inputtext.Text= ""
End Sub
-
Thanks
Thanks, works like a charm.
-System
-
Damn!
If I would see that message before Matthew, I would post that too.
:D
-
in a module:
Code:
Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
the commandbutton code
Code:
SetWindowText Me.Text1.hwnd, ""
replace text1 with anything, including labels !
-
sorry, you can't use it with labels :(
because they don't have a HWND variable unless you look for it.