How to select all the text in a text box? Can anyon please give me code for cut, copy and paste.
:p Kinjal :p
Printable View
How to select all the text in a text box? Can anyon please give me code for cut, copy and paste.
:p Kinjal :p
here you go:
Code:Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1)
To copy text:
To copy the selected text:Code:Private Sub Command1_Click()
Clipboard.Clear
Clipboard.SetText Text1.text
End Sub
To paste text:Code:Private Sub Command1_Click()
Clipboard.Clear
If Text1.SelText <> "" Then
Clipboard.SetText Text1.SelText
Else
End If
End Sub
Code:Private Sub Command2_Click()
Text1.text = ClipBoard.GetText()
End Sub
To cut text:
[/quote]Code:Private Sub Command1_Click()
Clipboard.Clear
Clipboard.SetText Text1.text
Text1.Text = ""
End Sub
To cut selection:
Code:Private Sub Command1_Click()
Clipboard.Clear
If Text1.SelText <> "" Then
Clipboard.SetText Text1.SelText
Text1.SelText = ""
Else
End If
End Sub
Cut and Copy are basically the same thing, except that when you cut, the text is cleared afterwards, whereas if you copy, than no text is cleared.
I know that, if you look at my code, you will discover that I do know that.
Thanks a lot!
:p Kinjal :p