5 Replies - 1151 Views - Last Post: 09 April 2012 - 08:02 AM Rate Topic: -----

#1 mikelash  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 17-June 11

how to right click an image?

Posted 01 April 2012 - 05:05 PM

so far i have control if you left click on an image because that is default in your form but how do i make it so there can be programming if i right click it?
Is This A Good Question/Topic? 0
  • +

Replies To: how to right click an image?

#2 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 583
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: how to right click an image?

Posted 01 April 2012 - 08:52 PM

If VB6 has a MouseDown event, use that.
Was This Post Helpful? 0
  • +
  • -

#3 Neku  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 268
  • Joined: 21-May 09

Re: how to right click an image?

Posted 02 April 2012 - 06:32 AM

VB6 does have events related to the mouse but not one specific for right button click.
via events MouseDown, MouseUp, MouseMove you can find whats the integer value of the buttons on you mouse and then use it to know when a right click has been made.
you may also consider certian cordinats so some areas on your form/control wont respond to the click unless they are in range.
Was This Post Helpful? 0
  • +
  • -

#4 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: how to right click an image?

Posted 02 April 2012 - 01:51 PM

Like this:
Sub myImage_MouseDown(Button As Integer)
If Button = vbRightButton Then
    'Do what you're gonna do
End If
End Sub
You can use integer values too, as Neku says, but the enumeration constants are easier to remember and understand.

Here's the doc on the subject.
Was This Post Helpful? 0
  • +
  • -

#5 TrentWard2012  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-April 12

Re: how to right click an image?

Posted 09 April 2012 - 01:44 AM

I think this will be possible with MouseDown(RightClick) Event.
Was This Post Helpful? 0
  • +
  • -

#6 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: how to right click an image?

Posted 09 April 2012 - 08:02 AM

View PostTrentWard2012, on 09 April 2012 - 09:44 AM, said:

I think this will be possible with MouseDown(RightClick) Event.

Can you explain further? Not sure exactly how this would work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1