Board index » cppbuilder » TListBox type speed for selection of items
Jochanan
![]() CBuilder Developer |
Jochanan
![]() CBuilder Developer |
TListBox type speed for selection of items2005-05-30 02:21:56 PM cppbuilder49 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. |
JD
![]() CBuilder Developer |
2005-05-31 02:40:47 PM
Re:TListBox type speed for selection of items
"Jochanan" < XXXX@XXXXX.COM >wrote:
Quote
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 |