Board index » delphi » 2nd post: Combobox problem

2nd post: Combobox problem

Hello all,

I'm using the standard TCombobox (style = simple) in Delphi 3 C/S and
I want to select an entry in a long list either by typing (part of)
the text and pressing Enter or by selecting it directly from the list
using the mouse. It now turns out that the OnClick is executed
whenever a key is pressed. Very annoying.
I've tried the RzCombobox from the Raize Compontents (downloadable
after online registration) and it has the same 'bug'.

Is this really a bug or am I doing something wrong?

Bye,

Helma van der Linden

 

Re:2nd post: Combobox problem


This sounds like typical behavior to me. If you want to alter it you will
have to dig through the Delphi source and learn how to override its
keyboard behavior.

--
Jon Foster
jfos...@microwing.com
Software Engineer
MICROWING, Incorporated

Helma van der Linden <h.vanderlin...@mi.unimaas.nl> wrote in article
<34BE2D42.35F23...@mi.unimaas.nl>...

Quote
> Hello all,

> I'm using the standard TCombobox (style = simple) in Delphi 3 C/S and
> I want to select an entry in a long list either by typing (part of)
> the text and pressing Enter or by selecting it directly from the list
> using the mouse. It now turns out that the OnClick is executed
> whenever a key is pressed. Very annoying.
> I've tried the RzCombobox from the Raize Compontents (downloadable
> after online registration) and it has the same 'bug'.

> Is this really a bug or am I doing something wrong?

> Bye,

> Helma van der Linden

Re:2nd post: Combobox problem


On Thu, 15 Jan 1998 16:37:39 +0100, Helma van der Linden

Quote
<h.vanderlin...@mi.unimaas.nl> wrote:
>  It now turns out that the OnClick is executed whenever a key is pressed.

Correct.

Quote
> Is this really a bug

No, it is not a bug. If you want, you can temporarily disable an
event-handler like this:

var
  Saved : TNotifyEvent;
begin
  Saved := ComboBox1.OnClick;
  try
    { Do something here }
  finally
    ComboBox1.OnClick := Saved;
  end;
end;

--
Rick Rogers (TeamB) | Fenestra Technologies

Re:2nd post: Combobox problem


I use the SofTouch Incombo, which has a OnCloseUp event.

I the OnDropDown, I save the current value.

In the onClick, I check if the dropdown is open.  if so I ignore the
event.

In the OnCloseUp, I look to see if the value is changed, and process
the "click" there.  

Re:2nd post: Combobox problem


Hi Scott,

FYI, the TRzComboBox also has an OnCloseUp event, so the
same technique could be used.

Ray
________________________________________________________________
Ray Konopka
Raize Software Solutions, Inc.
http://www.raize.com

Quote
>I use the SofTouch Incombo, which has a OnCloseUp event.

>I the OnDropDown, I save the current value.

>In the onClick, I check if the dropdown is open.  if so I ignore the
>event.

>In the OnCloseUp, I look to see if the value is changed, and process
>the "click" there.

Other Threads