 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jochanan Guest
|
Posted: Mon May 30, 2005 6:21 am Post subject: TListBox type speed for selection of items |
|
|
Hi,
Is there a way to cotrol the type speed while looking up items in the
TListBox.
the listbox is looking for the next word wile im stil typing my privius one.
Regards
jvdn.
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Tue May 31, 2005 6:40 am Post subject: Re: TListBox type speed for selection of items |
|
|
"Jochanan" <non (AT) nomail (DOT) com> wrote:
| Quote: |
[...] the listbox is looking for the next word wile im stil
typing my privius one.
|
The only thing that you can do is intercept the key strokes
before they make their way to the TTreeView. The first chance
that you have to see a keypress is in the TApplication::OnMessage
event. From here, you can monitor all Window messages sent to
your application and change them as needed.
//--- in the header -------------------------------------------
private: // User declarations
void __fastcall MyAppMessage( TMsg&, bool& );
public: // User declarations
__fastcall ~TForm1();
//--- in the unit ---------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
Application->OnMessage = MyAppMessage;
}
//-------------------------------------------------------------
__fastcall TForm1::~TForm1()
{
Application->OnMessage = NULL;
}
//-------------------------------------------------------------
void __fastcall TForm1::MyAppMessage( TMsg &Msg, bool &Handled )
{
if( Msg.message == WM_KEYDOWN || Msg.message == WM_KEYUP )
{
if( Screen->ActiveControl == SomeForm->TreeView1 )
{
if( Msg.message == WM_KEYDOWN )
{
// buffer the keystroke found in Msg.wParam
}
Msg.wParam = NULL;
}
}
}
//-------------------------------------------------------------
Your problem now becomes how to know when to do a lookup. Look
at starting and resetting a TTimer when the WM_KEYDOWN is
detected for the control.
~ JD
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|