Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

change the flashing thing

Posted on 2003-02-23
3
Medium Priority
?
154 Views
Last Modified: 2010-05-01
You see the little flashing thing in a textbox from where the text comes from. Does anyone know how to change the look of it.
0
Comment
Question by:mangaman3000
  • 2
3 Comments
 
LVL 5

Expert Comment

by:JohnMcCann
ID: 8002912
The flasshing thing is called the cret

you use the api function

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

To change it


0
 
LVL 44

Expert Comment

by:bruintje
ID: 8002913
Hello mangaman3000,

it's called a caret

you need 2 declarations

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

and use them in code like

CreateCaret Text1.hwnd, 0, w, h  ' create new caret size using some width and height
ShowCaret& Text1.hwnd       ' show the new caret

HAGD:O)Bruintje
0
 
LVL 5

Accepted Solution

by:
JohnMcCann earned 200 total points
ID: 8002930
I quick example.

Start a new VB project (exe)
On form1 add a textbox and a picturebox set the pictureboc autosize ot true.  Add a picture not an icon as these don't work very well (in my exp).

Goto the code module of form1 and paste

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 Declare Function GetFocus Lib "user32" () As Long

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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question