Board index » delphi » TStringGrid's PopupMenu

TStringGrid's PopupMenu

When my TStringGrid hasn't custom PopupMenu, the default one, has elements
"Copy", "Paste", etc.
How to add these elements in my custom menu?

Best Regards
Alexander Mintchev

 

Re:TStringGrid's PopupMenu


On Wed, 18 Jul 2001 13:33:20 -0700, "CTEHATA" <cteh...@borsabg.com>
wrote:

Quote
> When my TStringGrid hasn't custom PopupMenu, the default one,
> has elements "Copy", "Paste", etc.

This menu doesn't come from Delphi's TStringGrid class. In fact, it
doesn't come from the Delphi VCL at all.  Instead, it comes from some
versions of Microsoft Windows, and is present on Windows edit controls
that don't have popup menus.

Quote
> How to add these elements in my custom menu?

You'd have to use the Windows API, if it is even possible, and I'm not
sure anyone has ever figured out how. Anyway, it is incredibly trivial
for you to make your own Delphi popup menu that includes clipboard
support, which would also allow you to add whatever you want to it, so
this is clearly the way to go.
--
Rick Rogers (TeamB); Fenestra Technologies, http://www.fenestra.com/
  Use Borland servers; posts via others are not seen by TeamB.
  For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:TStringGrid's PopupMenu


If you have Delphi 5 you can set up std actions for cut, copy, paste etc and
use them.
Quote
"CTEHATA" <cteh...@borsabg.com> wrote in message news:3b5565e3_1@dnews...
> When my TStringGrid hasn't custom PopupMenu, the default one, has elements
> "Copy", "Paste", etc.
> How to add these elements in my custom menu?

> Best Regards
> Alexander Mintchev

Re:TStringGrid's PopupMenu


Thank you for your quick reply.

I can work with TCipboard, but I can't find a property to get/set the
selected text in the TStringGrid's cell.
Can you give me any idea?

Thanks in advance.
Alexander Mintchev

Re:TStringGrid's PopupMenu


On Wed, 18 Jul 2001 19:48:56 -0700, "CTEHATA" <cteh...@borsabg.com>
wrote:

Quote
> I can't find a property to get/set the
> selected text in the TStringGrid's cell.

Create a TStringGrid descendant. In your descendant, redeclare the
InplaceEditor property from protected to public. Then use this
property; it is a TCustomMaskEdit descendant.
--
Rick Rogers (TeamB); Fenestra Technologies, http://www.fenestra.com/
  Use Borland servers; posts via others are not seen by TeamB.
  For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:TStringGrid's PopupMenu


Thank you verry much Rick. It worked, and saved me a lot of time.
                                                Alexander Minchev
Quote
Rick Rogers (TeamB) wrote in message ...
>On Wed, 18 Jul 2001 19:48:56 -0700, "CTEHATA" <cteh...@borsabg.com>
>wrote:

>> I can't find a property to get/set the
>> selected text in the TStringGrid's cell.

>Create a TStringGrid descendant. In your descendant, redeclare the
>InplaceEditor property from protected to public. Then use this
>property; it is a TCustomMaskEdit descendant.
>--
>Rick Rogers (TeamB); Fenestra Technologies, http://www.fenestra.com/
>  Use Borland servers; posts via others are not seen by TeamB.
>  For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Other Threads