By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,084 Members | 1,969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,084 IT Pros & Developers. It's quick & easy.

disable the mouse - working first time

P: 36
I need to disable the mouse on click of ADD button.
I wrote following code for that

Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long

on click of ADD
ShowCursor false

after ADD opertaion is finished
ShowCursor true

This is wroking when I click the ADD button for first time. But when I click on ADD button again it does not work.
Any idea why it's behaving like that?
Sep 18 '07 #1
Share this Question
Share on Google+
1 Reply


QVeen72
Expert 100+
P: 1,445
Hi,

ShowCursor (Hide and Show ) are to be used as a Couple.
Means if you call the ShowCursor function more than once passing False as an argument, then you must call ShowCursor with True an equal number of times, otherwise the cursor may remain Invisible/Visible depending on how many times u have passed which argument.

It is always a better Idea to write Seperate Subprocedures to Show and Hide. Keep a FormLevel Variable and if the Cursor is already hidden (Check the Variable) then do not do anything, Exit Sub, Else Hide. Do Same for Showing the cursor..

Regards
Veena
Sep 18 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.