Solved

PopupMenus and StringGrids

Posted on 1998-01-16
1
245 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi cmd execution 6 60
Open a URL with Internet Explorer in a new tab (not a new window) 1 88
Delphi...Split view - idea? 1 67
Delphi and Access based Enumeration 9 59
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

805 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