web development India freelance website designer
'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)
'Add 2 Text Boxes and 1 PictureBox to your form. Add BMP Picture to the Picture Box.
'This Picture will be Text1 Caret.
'Insert this code to the module :

Declare Function CreateCaret Lib "user32" (ByVal hwnd As Long, _
ByVal hBitmap As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long
Declare Function GetFocus Lib "user32" () As Long

'Insert this code to your form:

Private Sub Text1_GotFocus()
h& = GetFocus&()
b& = Picture1.Picture
Call CreateCaret(h&, b&, 10, 10)
X& = ShowCaret&(h&)
End Sub

Private Sub Text2_GotFocus()
h& = GetFocus&()
'The '25' below is the Caret Width. The '30' Below is the Caret High
Call CreateCaret(h&, 0, 25, 30)
X& = ShowCaret&(h&)
End Sub


Change The Caret Of A Text Box

1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550

Freelance ASP PHP web development | Web developer India Web development India| Prayagasoft - web designer India, Ecommerce developer india, Ecommerce design