Solved

PopupMenus and StringGrids

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now