Solved

Listbox problem

Posted on 1997-09-30
6
153 Views
Last Modified: 2011-10-03
I have an application which uses a listbox to view certain criteria which matches the item selected.  When I click on an item, it will read a database and display that information.

However, I am also trying to drag from that listbox into another one.  This is where the problem starts.  I dont want the database lookup to happen when I am dragging, but unfortunately, the OnMouseDown and OnClick are the same to the extent is is trying to do the D&D at the same time as the lookup.

I have tried activating the lookup using OnMouseUp, but for some reason, the Drag and Drop routines take over that function as well.

Is there a way I can do this?????

Any help would be appreciated.

Stu
0
Comment
Question by:Stuart_Johnson
6 Comments
 
LVL 1

Expert Comment

by:sassas081597
ID: 1346657
Hi!
Why not to look your Database on DblClick event?
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 1346658
Im not using a TDBListBox.  Its just a TListBox.  

Thanks anyway.

Stu

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1346659
Well, had the same problem and still have it! Tried everything I could think of, but no, nothing helped. I worked around the problem. I used for one purpose the right button and for the D&D the left button.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Accepted Solution

by:
ClausChristianUde earned 50 total points
ID: 1346660
Yes, it maybe not a very good way, but it will work:

1. Set a variable AreYouDragging := FALSE
2. Wait 500msec before you start searching the database. Do it by:

    Procedure Delay(ms : LongInt);
    Var
      TickCount : LongInt;
      M         : TMsg;
    Begin
      TickCount := GetTickCount;
      While GetTickCount - TickCount < ms do
        If PeekMessage(M,0,0,0,pm_Remove) then
          Begin
            TranslateMessage(M);
            DispatchMessage(M);
          End;
    End;

2. If drag and drop starts set AreYouDragging := TRUE

3. if the AreYouDragging is FALSE you search the database


0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 1346661
I actually found out how to do it, but as EE doesnt have a way of begin able to cancel a question, I had to leave it open.

FYI, I used If TARGET = NIL then {do db lookup}

This seems to be the easiest and cleanest way of doing it - and it works like a charm!!!

Thanks for you help anyway.

Stu
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 1346662
I actually found out how to do it, but as EE doesnt have a way of begin able to cancel a question, I had to leave it open.

FYI, I used If TARGET = NIL then {do db lookup}

This seems to be the easiest and cleanest way of doing it - and it works like a charm!!!

Thanks for you help anyway.

Stu
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
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.

746 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

10 Experts available now in Live!

Get 1:1 Help Now