Solved

PopupMenus and StringGrids

Posted on 1998-01-16
1
250 Views
Last Modified: 2010-04-04
Hello, I would like to be able to Right  Mouse click a specific cell in a StringGrid and have a PopupMenu show - What should I do?
0
Comment
Question by:engtech
[X]
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
1 Comment
 
LVL 4

Accepted Solution

by:
itamar earned 50 total points
ID: 1356918
I think this code is OK for you:

procedure TForm1.StringGrid1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var Acol, ARow : LongInt;
begin
     If Button = mbRight Then begin
        StringGrid1.MouseToCell(X, Y, ACol, ARow);
        If (ACol = 2) And (ARow = 3) Then
           Popupmenu1.AutoPopup := True
        Else
           Popupmenu1.AutoPopup := False;
     end;
end;

This will shot popupmenu only for the cell with coordinates Col = 2 and Row = 3.

IHTH

P.S.: Any doubts, place a comment before grading the answer.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Correct Component for Shopping Cart. 2 133
creating threads in delphi 1 199
shape, triangle, dbctrlgrid 3 46
Add New Database Table in database file using delphi 3 54
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…

732 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