Solved

Simple simple question.

Posted on 2002-07-28
1
134 Views
Last Modified: 2010-04-04
I want to make ListBox behave as though i just left mouse clicked on it when i press the Right mouse button, i tried
ListBox1.Perform(WM_MBUTTONDOWN,0,0); but it did not work? Anyone know how?

-

  Thanks Craig C.
0
Comment
Question by:craig_capel
1 Comment
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 50 total points
ID: 7183256
Hello

 try this, the ItemAtPos method will do the trick

procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  Pon : TPoint;
begin
  Pon.x := X;
  Pon.y := Y;
  if Button = mbRight then
  ListBox1.ItemIndex :=  ListBox1.ItemAtPos(Pon,True);
end;

Best regards
Mohammed Nasman
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
creating manifest for my dll that called from activex 6 114
Simple Delphi Question 9 90
Communication Between RC4 Delphi <-> PHP 3 114
firemonkey keyboard covers the controls 1 25
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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