[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PopupMenus and StringGrids

Posted on 1998-01-16
1
Medium Priority
?
254 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 150 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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 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