Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > .NET

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 06-22-2006, 03:26 AM
sequel sequel is offline
Registered User
 
Join Date: Jun 2005
Posts: 28
Lock mouse input

How can we lock mouse just for our application. I mean ... i dont want to lock mouse for the windows as "BlockInput" API does, i just want to block mouse input on my application for a specified time.

Regards
Reply With Quote
  #2  
Old 06-22-2006, 09:11 AM
Phil Weber Phil Weber is offline
Super Moderator
 
Join Date: Nov 2003
Location: Portland, OR
Posts: 8,171
Set the Enabled property of the visible form(s) or controls to False.
__________________
Phil Weber
http://www.philweber.com

Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Reply With Quote
  #3  
Old 06-22-2006, 09:48 AM
sequel sequel is offline
Registered User
 
Join Date: Jun 2005
Posts: 28
by setting Enabled=False, form is grayed out
Reply With Quote
  #4  
Old 06-22-2006, 11:58 AM
Phil Weber Phil Weber is offline
Super Moderator
 
Join Date: Nov 2003
Location: Portland, OR
Posts: 8,171
OK, how about simply ignoring any mouse clicks you receive?
__________________
Phil Weber
http://www.philweber.com

Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Reply With Quote
  #5  
Old 06-23-2006, 02:40 AM
sequel sequel is offline
Registered User
 
Join Date: Jun 2005
Posts: 28
Yes, this is what i need, but how?? Do i need to capture the mouse events for controls, IMO this is not a good approach. What do you suggest?

Last edited by sequel; 06-23-2006 at 03:00 AM.
Reply With Quote
  #6  
Old 06-23-2006, 04:57 AM
Phil Weber Phil Weber is offline
Super Moderator
 
Join Date: Nov 2003
Location: Portland, OR
Posts: 8,171
Code:
' Declare form-level 'ignore mouse' flag
' Set to True when you want to 'disable' the mouse
Private bIgnoreMouse As Boolean

Private Sub Button1_Click(ByVal sender As System.Object, _ 
    ByVal e As System.EventArgs) Handles Button1.Click
    ' Check flag in all mouse-related event handlers
    If Not bIgnoreMouse Then
        ' Handle mouse click
    End If
End Sub
__________________
Phil Weber
http://www.philweber.com

Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can vb6 makes its control not response to mouse click and keyboard input? halosome VB Classic 5 05-16-2006 07:20 AM
Capturing Mouse Movements outside of screen resolution Chris Eastwood VB Classic 4 03-28-2002 02:26 PM
Mouse Movement Playback Eugene VB Classic 4 12-19-2000 01:52 PM
Mouse Movement Playback Eugene VB Classic 0 12-19-2000 12:13 PM
how to easily lock out the mouse clicks Cindy Zhang authorevents.appleman 2 04-10-2000 04:28 PM


All times are GMT -4. The time now is 12:36 AM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.