Err.. huh?
You want to swap the pipe character '|' with the underscore character'_' in a text box?
Printable View
Err.. huh?
You want to swap the pipe character '|' with the underscore character'_' in a text box?
yea
Text1.Text = Replace(Text1.Text, "|", "_")
he means he wan'ts to replace the Carrot(blinking I)
with a blinking underscore.... like in DOS
Ohhh I seeeee, the ibeam :D Sorry, I didn't know what you were on about, I thought you meant the pipe character.
No idea mate :)
Try using the WinAPI caret functions to change it. Dan Appleman's book Visual Basic Programmer's Guide to the Win32 API is a great reference for creating your own carets.
Use the CreateCaret() function. Add the following code to a Form with a PictureBox and a TextBox. In the PictureBox, load a picture of how you want the caret to look.
Code:Private Declare Function CreateCaret Lib "user32" (ByVal hwnd As Long, ByVal hBitmap As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Text1_GotFocus()
CreateCaret Text1.hwnd, Picture1.Picture, 0, 0
ShowCaret Text1.hwnd
End Sub
that works perfectly, but it appears on TOP of the text, how do I get it to appear at the bottom of the text
Try turning the picture for the caret upside down.