Solved

Simple simple question.

Posted on 2002-07-28
1
132 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:
mnasman 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

23 Experts available now in Live!

Get 1:1 Help Now