DBGrid  VB6 - Can I select a row with a right click?

Posted on 2003-02-23
Medium Priority
Last Modified: 2012-06-27
I have a DBGrid and when I right click on one of the rows a popup menu is displayed. My problem is that I am not able to set the current active row with a right click. Currenltly, I first have to left click on a row (select it first)and then do  a right click for the popup menu.

It would be much easier if I could select the row with the right click and at the same time pop the pop up menu.

Please help
Question by:Dipika
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

IeuanJ earned 200 total points
ID: 8007013
Not tested this but you can give it a try.

Private Sub DBGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyRButton Then
    MsgBox "Your Code Here"
  End If
End Sub

Expert Comment

ID: 8901232
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question