Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox - SQL
Message
 
 
To
27/04/2001 10:42:06
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00497353
Message ID:
00500720
Views:
37
Chuck,

The simplest solution here would be to set default property of your Find command button to true. So, each time you hit Enter (no matter there), it will fire click event of the Find button.

If you don't want this behavior for Enter button, you can program this way:

Add a method to your form, say, MyFind(). Put all your code, which you currently have in Command1.Click into this new method (update references to the objects, if needed).

Now, in the Command1.Click just put thisform.MyFind() and the same in KeyPress:
if nKeyCode=13 && Not, not the lastkey()
   thisform.MyFind()
   nodefault
endif
>OK. Got it (yes, the _tally is kept/used as well). Thanks.
>
>I have anooooooother question. Should be in new thread, but but but anyway. I have the following command in the KeyPressEvent in the textboxes...
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>IF LASTKEY() = 13
>	wait window 'Enter key pressed'
>	DO ThisForm.Commandgroup1.Command1
>ENDIF
>
>
>I know the DO command isn't going to DO it, but put it there to ask the question :) Would this (ClickEvent of the 'Find' button) have to be a PROCEDURE for in order to do the DO? The reason for this is to go faster, click on Enter while in the textbox instead of mousing it over the 'Find' or TABing.
>
>Chuck
>
>>Highlighting the first record in a listbox is easy: use
thisform.list1.selected(1)=.t.
(check first, if you have records in a listbox, of course - I added check by _tally)
>>
>>Seek should work, I believe, or you can use locate.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform