?
Solved

change the flashing thing

Posted on 2003-02-23
3
Medium Priority
?
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

752 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