Solved

Simple simple question.

Posted on 2002-07-28
1
133 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

12 Experts available now in Live!

Get 1:1 Help Now