|
-
Sep 10th, 2000, 09:05 PM
#1
Thread Starter
Junior Member
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
-
Sep 10th, 2000, 09:27 PM
#2
Try this:
Code:
Private Sub cleartext_Click()
inputtext.Text= ""
End Sub
-
Sep 10th, 2000, 09:31 PM
#3
Thread Starter
Junior Member
Thanks
Thanks, works like a charm.
-System
-
Sep 11th, 2000, 01:55 AM
#4
-
Sep 11th, 2000, 04:19 AM
#5
Conquistador
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 !
-
Sep 11th, 2000, 04:21 AM
#6
Conquistador
sorry, you can't use it with labels 
because they don't have a HWND variable unless you look for it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|