Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Mouse click & Shift pressed


Reply
 
Thread Tools Display Modes
  #1  
Old 07-14-2003, 05:15 PM
vanbinsbergen vanbinsbergen is offline
Newcomer
 
Join Date: Jul 2003
Posts: 8
Default Mouse click & Shift pressed


Hi.

I would like to know how I can check if the shift key is pressed, when I detect a mouse click;

Private Sub lvListview_itemclick(ByVal Item As MSComctlLib.ListItem)

If Shiftkey=Pressed then
...
Endif

End Sub



Thank you.
__________________
Lafjes er tegen aan gereden...
Reply With Quote
  #2  
Old 07-14-2003, 05:18 PM
Iceplug's Avatar
Iceplug Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
Default

Well, you'd need to check if the Shift key was pressed in the listview's keydown event and hasn't been released in the keyup event by setting some boolean value to True in the KeyDown and False in the KeyUp event. Then you can check this value in the Click event.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #3  
Old 07-14-2003, 05:26 PM
vanbinsbergen vanbinsbergen is offline
Newcomer
 
Join Date: Jul 2003
Posts: 8
Default

Ok, so it's not possible to check the keyboard status avoiding an additional routine like KeyDown...

Your suggestion, however, seems to be right.

Thanks.
__________________
Lafjes er tegen aan gereden...
Reply With Quote
  #4  
Old 07-14-2003, 05:29 PM
Iceplug's Avatar
Iceplug Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
Default

Well, you could use something like the GetKeyState API.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #5  
Old 07-14-2003, 05:32 PM
vanbinsbergen vanbinsbergen is offline
Newcomer
 
Join Date: Jul 2003
Posts: 8
Default

Will do that,

Thank you.
__________________
Lafjes er tegen aan gereden...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
MSFlexGrid Mouse click problem Anson General 2 01-03-2003 09:52 AM
Simple problem regarding mouse click xxfobxx General 8 12-17-2002 05:12 AM
the mousedown isnt very fast if u click fast, is there another way to find if pressed aaa Game Programming 12 10-11-2002 05:08 AM
mouse down / mouse up xmen64 Interface and Graphics 5 10-09-2002 10:36 AM
subject About Sendkeys & code to Right mouse click visualbasic700e General 2 11-28-2000 02:43 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->