Thanks Nirav, that worked a treat.

Cheers,
Ross.

NIRAV KAKU wrote:

> Ross,
>
> procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;
>   Shift: TShiftState; X, Y: Integer);
> var
>   Z: TPoint;
> begin
>   Z.x := X;
>   Z.y := Y;
>   ListBox1.ItemIndex := ListBox1.ItemAtPos(Z, True);
> end;
>
>         Hope this helps.
>
> regards,
> NIRAV KAKU
>
> On 20 Jul 01, at 18:10, Ross Levis wrote:
>
> > Is there a simple way of forcing an item to be selected in a listbox by
> > right-clicking the item before a Popup Menu is displayed.  I want it to
> > work the way a ListView does where right-click does select the item.
> > Currently the user has to left-click & then right-click.
> >
> > Cheers,
> > Ross.
> >
> >
> > ---------------------------------------------------------------------------
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> > To UnSub, send email to: [EMAIL PROTECTED]
> > with body of "unsubscribe delphi"
> > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> >
>
> - From the Shreemat Bhägwat Gïta -
> 'Sarcasm is the lowest form of wit.'
> ---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to