Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

asked on

How to hide the cursor, part 2

Hi everybody,

A few hours ago I have asked how to hide my cursor on
the canvas of the component. Received some good solutions.
But after testing their are a few minor problems, that I hope
you can help me with it.

+ The cursor has to be hidden on startup.
+ When I hide the cursor and then show it again it blinks twice.

Could you PLEASE help me to find the faults!

The example on my site:http://members.home.nl/peterkiers/
(Underneath the Under Construction bar you see a floppy disk)

Greetings,

P.
Avatar of TheRealLoki
TheRealLoki
Flag of New Zealand image

Have you tried setting form1.doublebuffered := true;
This might fix the blinking.
I haven't seen your solution, but in case it haasn't been said yet, you could create your own cursor, which just happens to be blank, and set that cursor as your componen'ts cursor
Avatar of Peter Kiers

ASKER

I have tried form1.doublebuffered := true, but the cursor still flickers twice.

P.
Check this

procedure TMainForm.ShowCursor1Click(Sender: TObject);
begin
 MyDrawingPanelx1.CursorFlashTimer.Enabled :=MyDrawingPanelx1.Blinking;
 MyDrawingPanelX1.CursorVisible:= True;
end;
Oke,

But when I turn on the cursor to blink in the Connect-Dialog screen
after pressing the connect-button the cursor starts blinking
and when i press menu-item Hide cursor the cursor doesn't dissapear

P.

Damn your good.

I'll be back in several hours because i have an exame to take.
But the purpose for my programm has to be this:

+at Startup the cursor has to be hidden
+When the user presses Show Cursor the cursor has to be showed (this is done)
+When the user presses Hide Cursor the cursor has to be hidden (this is done)
+When the user selects blinking cursor in the dialog-screen after pressing on
  the Connect-button the cursor will blink, but when the user click on hide cursor
  the cursor has to be hidden, and when the user again click on show cursor
 The cursor has to appear again blinking.

Peter.
this code is working for me.

procedure TMainForm.ShowCursor1Click(Sender: TObject);
begin
 MyDrawingPanelx1.CursorFlashTimer.Enabled :=MyDrawingPanelx1.Blinking;
 MyDrawingPanelX1.CursorVisible:= True;
end;

procedure TMainForm.HideCursor1Click(Sender: TObject);
begin
 MyDrawingPanelx1.CursorFlashTimer.Enabled :=False;
 MyDrawingPanelX1.CursorVisible:= False;
end;
Hi, dinilud.

I have tested the code and it works for me to.
Can you (before I award the points) PLEASE to that
with the option Cursor Type. Because when I choose
Cursortype BOX en then press Connect the cursor
appears as a box-shape, but when I press Hide Cursor
the cursor doesn't dissappear.

The blinking-part works great. Thank you...

Peter




ASKER CERTIFIED SOLUTION
Avatar of dinilud
dinilud
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yip, that's the answer, 500 p. comming your way...

Peter Kiers