Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6195853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:32:27+00:00 2026-05-24T03:32:27+00:00

There is a list View + a PopUpMenu. I need that the PopUpMenu appears

  • 0

There is a list View + a PopUpMenu. I need that the PopUpMenu appears when items are present. The menu must not appears when 0 items.

Is this approximate code appropriate (can be used as a basis)?

procedure TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var P: TPoint;
begin
  P:=GetClientOrigin;
  if Button = mbRight then
     PopupMenu1.Popup(X+P.X+StringGrid1.Left, Y+P.Y+StringGrid1.Top);
end;

Are there other ways?

Thanks!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:32:28+00:00Added an answer on May 24, 2026 at 3:32 am

    Firstly, don’t do anything on a mouse event because the popup menu can be invoked from the keyboard.

    The best way to do this, in my view, is to handle the OnPopup event. If you want the menu not to appear call Abort.

    procedure TForm1.PopupMenu1Popup(Sender: TObject);
    begin
      if SomeCondition then
        Abort;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list view that can display items based on internal state (it
I implemented a custom list view, but now there's no visual feedback that an
I need to create the list view that loads data dynamically based on scroll
There is one win forms application with some list view items. I'd like to
There is a list view and this is loaded dynamically upon loading the page.
I wanted to generate a list view using below code. But after running this
is there any way to hide list view Item in ListView ?
In my Android application, I have a simple list view with adapter. There's a
I'm using an expandable list view to display folders and files that are in
I want to access the data that was databound to my list view when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.