jpdupont
asked on
How to modify the caret width/height in a edit control.
I want to modify the caret width/height in a edit control.
I found "CreateCaret" and "ShowCaret" in the WinAPI.Hlp
I tried to play with these functions but I get the old caret.
- I want to know where and how call the procs.
- How work with a "bitmap " to create the caret ?
Some sample code would be very helpful.
I found "CreateCaret" and "ShowCaret" in the WinAPI.Hlp
I tried to play with these functions but I get the old caret.
- I want to know where and how call the procs.
- How work with a "bitmap " to create the caret ?
Some sample code would be very helpful.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add the following to the code:
procedure TForm1.Edit2Change(Sender: TObject);
begin
FBitmap:=LoadBitmap(0,MAKE INTRESOURC E(OBM_RGAR ROW ));
CreateCaret(Edit2.Handle, FBitmap, GetSystemMetrics(SM_CXBORD ER),GetSys temMetrics (SM_CYBORD ER));
ShowCaret(Edit2.handle);
end;
procedure TForm1.Edit2Change(Sender:
begin
FBitmap:=LoadBitmap(0,MAKE
CreateCaret(Edit2.Handle, FBitmap, GetSystemMetrics(SM_CXBORD
ShowCaret(Edit2.handle);
end;
ASKER
Have you try the code you send ;) ?
Exactly the same effect :
The code don't work.
JP
Exactly the same effect :
The code don't work.
JP
Yes, I tried. Post your EMail and I'll send it to you.
I tested it in Delphi 3, WinNT4.
I tested it in Delphi 3, WinNT4.
ASKER
Ronit,
I'm using D3.02, Win95.
jpdupont@skynet.be
Thanks for the help !
I'm using D3.02, Win95.
jpdupont@skynet.be
Thanks for the help !
ASKER
The sample code work.
But I get some flicker when using the edit with new caret
(I tried no bitmap caret).
Probably there is an other way to do the work.
Thank for help.
But I get some flicker when using the edit with new caret
(I tried no bitmap caret).
Probably there is an other way to do the work.
Thank for help.
ASKER
I paste your code on my form.
(FBitmap : HBitmap ?)
The bitmap is drawned on the edit. The old caret is also there.
The bitmap disapear when the edit is redrawn (type some text in).
I try without bitmap (with a 10x10 caret).
Same problem.