Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info.
SEARCH THE FOXITE.COM VISUAL FOXPRO FORUM ARCHIVES
Please enter one or more search terms:
search (case insensitive):


order by:


sort:
SEARCH RESULT Results 1126 - 1150 of 1835 for nkeycode. (0.2028013 seconds)


RE: Message box
Thread ID: 318323 Yousfi Benameur RE: Message box In my Test.scx i placed one text box namely txtbasic, user want to enter only numeric value so i set format property "9" so user can not enter any character on the text box. Instead of this i want alternate method, when user try to enter any character on the text box the message box pop up and tell "Hey It is not Numeric" > how to do this? in the textbox keypress event put this code. LPARAMETERS nKeyCode, nShiftAltCtrl if !type(chr(m.nkeycode))=="N" messagebox("not a numeric value !",16) endi Regards Yousfi Benameur

RE: Message box
Thread ID: 318323 Bhushan Sahni RE: Message box In my Test.scx i placed one text box namely txtbasic, user want to enter only numeric value so i set format property "9" so user can not enter any character on the text box. Instead of this i want alternate method, when user try to enter any character on the text box the message box pop up and tell "Hey It is not Numeric" > how to do this? > in the textbox keypress event put this code. LPARAMETERS nKeyCode, nShiftAltCtrl if !type(chr(m.nkeycode))=="N" messagebox("not a numeric value !",16) endi > Regards Yousfi Benameur Hi Yousfi, What about the Decimal "."? I think it will not work for . (Dot) Regards Bhushan Sahni

RE: Message box
Thread ID: 318323 Yousfi Benameur RE: Message box > in the textbox keypress event put this code. LPARAMETERS nKeyCode, nShiftAltCtrl if !type(chr(m.nkeycode))=="N" messagebox("not a numeric value !",16) endi > Regards Yousfi Benameur > Hi Yousfi, > What about the Decimal "."? > I think it will not work for . (Dot) > Regards Bhushan Sahni Visual Foxpro a dream house for developers thank you Bhushan ,you are right in part (because the user want inputmask to "9" numeric input only ),is yet the effect of Aid El Fitr holidays. then can make some characters exceptions like , and . LPARAMETERS nKeyCode, nShiftAltCtrl if !type(chr(m.nkeycode))=="N" if nkeycode

RE: Method don't run
Thread ID: 144346 Vladimir Zhuravlev RE: Method don't run Change in your code Keypress event LPARAMETERS nKeyCode, nShiftAltCtrl if nkeycode = -1 !! code of f2 do what you wish to do endif MVP , www.foxclub.ru domain owner 100 friends are better than 100 dollars.

RE: Method don't run
. ThisForm.KeyPreview = .t. *** In the KeyPress Event *** LPARAMETERS nKeyCode, nShiftAltCtrl IF nKeyCode = -1 BROWSE ENDIF Ken You shall know the truth - and the truth shall set you free. (John

RE: Method No Longer Works!!
is in the formset top level object. On the form that calls the method I used the keypress event in the form like so: IF nKeyCode = 3 && In your case the Page down key Thisformset.mymethod Endif Pete from the Great White

RE: Method No Longer Works!!
Thread ID: 39863 Brian Thomas RE: Method No Longer Works!! Hi, I gota formset with 4 forms in it. On one of the forms I gota method that is run via pressing the F9 key. The method is in the formset top level object. On the form that calls the method I used the keypress event in the form like so: IF nKeyCode = 3 && In your case the Page down key Thisformset.mymethod Endif > Pete from the Great White North. (Only in Canada, ay.) Over and Out ... pete.sass@foxite.com That seems a good solution too...thanks Pete! Brian

RE: Methods and ON KEY LABEL
Thread ID: 135720 Don Higgins RE: Methods and ON KEY LABEL Real quick one: > How can I assign methods to ON KEY LABEL events ? > Ex. ON KEY LABEL ALT+S Thisform.container1.visible = .T. > I know we cant just use that code but how can I make that happen ? > > > Ryan J. Lashway http://www.lashtech.com Use the KeyPress and KeyPreview. Set keypreview to .T. In the keypress event put the code. For example, I want the Letter D to jump to a textbox called down_payment so I use: DO CASE CASE THISFORM.pageframe1.ACTIVEPAGE = 1 DO CASE CASE nKeyCode = 100 .OR. nKeyCode = 68 ** Letter D for DownPay Field THISFORM.pageframe1.paymentCalcPage.downpay.SETFOCUS

RE: Methods and ON KEY LABEL
, deactivate ON KEY LABEL ALT+S > Cetin Basoz Cetin, This should work - I use something similar to toggle child images on or off: * Form's KeyPress() LPARAMETERS nKeyCode, nShiftAltCtrl * Toggle the image if Ctrl+Shift+I IF nKeyCode = 9 AND nShiftAltCtrl = 3 ThisForm.ToggleImage() NODEFAULT ENDIF Ken You shall know the truth - and the truth shall set you free. (John 8:33)

RE: Methods and ON KEY LABEL
, deactivate ON KEY LABEL ALT+S > Cetin Basoz > Cetin, > This should work - I use something similar to toggle child images on or off: * Form's KeyPress() LPARAMETERS nKeyCode, nShiftAltCtrl > * Toggle the image if Ctrl+Shift+I > IF nKeyCode = 9 AND nShiftAltCtrl = 3 ThisForm.ToggleImage() NODEFAULT ENDIF > > Ken You shall know the truth - and the truth shall set you free. (John 8:33) Yes Ken, It should work, I meant

RE: Methods and ON KEY LABEL
, deactivate ON KEY LABEL ALT+S > Cetin Basoz > Cetin, > This should work - I use something similar to toggle child images on or off: * Form's KeyPress() LPARAMETERS nKeyCode, nShiftAltCtrl > * Toggle the image if Ctrl+Shift+I > IF nKeyCode = 9 AND nShiftAltCtrl = 3 ThisForm.ToggleImage() NODEFAULT ENDIF > > Ken You shall know the truth - and the truth shall set you free. (John 8:33) > Yes Ken, It should work, I meant

RE: Methods and ON KEY LABEL
, deactivate ON KEY LABEL ALT+S > Cetin Basoz > Cetin, > This should work - I use something similar to toggle child images on or off: * Form's KeyPress() LPARAMETERS nKeyCode, nShiftAltCtrl > * Toggle the image if Ctrl+Shift+I > IF nKeyCode = 9 AND nShiftAltCtrl = 3 ThisForm.ToggleImage() NODEFAULT ENDIF > > Ken You shall know the truth - and the truth shall set you free. (John 8:33) > Yes Ken, It should work, I meant

RE: Methods and ON KEY LABEL
, deactivate ON KEY LABEL ALT+S > Cetin Basoz > Cetin, > This should work - I use something similar to toggle child images on or off: * Form's KeyPress() LPARAMETERS nKeyCode, nShiftAltCtrl > * Toggle the image if Ctrl+Shift+I > IF nKeyCode = 9 AND nShiftAltCtrl = 3 ThisForm.ToggleImage() NODEFAULT ENDIF > > Ken You shall know the truth - and the truth shall set you free. (John 8:33) > Yes Ken, It should work, I meant

RE: Mimic Windows Activation Key Entry
alternative to replicate the behavior, I put some code into the keypress method as follows: > LPARAMETERS nKeyCode, nShiftAltCtrl ODEFAULT(nKeyCode, nShiftAltCtrl) LOCAL tk_fldlen tk_fldlen=LEN(ALLTRIM(this.Value)) IF tk... the "-" when calculating the length. This should do what you want for the data entry: LPARAMETERS nKeyCode, nShiftAltCtrl LOCAL tk_fldlen tk_fldlen = LEN( ALLTRIM( CHRTRAN( this.Value, '-', '' ))) IF tk_fldlen>0 AND MOD

RE: Mimic Windows Activation Key Entry
alternative to replicate the behavior, I put some code into the keypress method as follows: > LPARAMETERS nKeyCode, nShiftAltCtrl ODEFAULT(nKeyCode, nShiftAltCtrl) LOCAL tk_fldlen tk_fldlen=LEN(ALLTRIM(this.Value)) IF tk... to ignore the "-" when calculating the length. This should do what you want for the data entry: LPARAMETERS nKeyCode, nShiftAltCtrl LOCAL tk_fldlen tk_fldlen = LEN( ALLTRIM( CHRTRAN( this.Value, '-', '' ))) IF tk_fldlen>0 AND MOD

RE: Mimic Windows Activation Key Entry
Thread ID: 222931 Andy Kramek RE: Mimic Windows Activation Key Entry > The issue with this code is that you need to reposition SelStart and ensure that you are always trimming the value. You also need to ignore the "-" when calculating the length. This should do what you want for the data entry: LPARAMETERS nKeyCode, nShiftAltCtrl LOCAL tk_fldlen tk_fldlen = LEN( ALLTRIM( CHRTRAN( this.Value, '-', '' ))) IF tk_fldlen>0 AND MOD(tk_fldlen,4)=0 this.Value= ALLTRIM( this.Value ) + "-" This.SelStart = LEN( ALLTRIM( This.Value )) ENDIF > (You will need to add code to handle backspace and deletions too, or else the user won't be able to correct a mistake). > As for pasting in, you will need

RE: Missed Behav of ENTER Key
event of the form. There you should have code like that If nKeyCode = code of the button (you take the code from Help - Inkey) do something Endif Ciprian Zaharia Fox4Ever

RE: Modify Value after Decimal in Grid
wrote this IF nKeyCode= -3 KEYBOARD '{END}' FOR i = 1 TO 2 KEYBOARD '{LEFTARROW}' ENDFOR ENDIF so when user reach your column press f4 cursor will goto the after decimal. Anil My Blog

RE: Modify Value after Decimal in Grid
> Sanjay Karia. > in your grid1.column1.text1.keypress wrote this > IF nKeyCode= -3 KEYBOARD '{END}' FOR i = 1 TO 2 KEYBOARD '{LEFTARROW}' ENDFOR ENDIF > so when user reach your column press f4 cursor will goto the after

RE: month days?
Thread ID: 353748 Nandkishor Lande RE: month days? if i have date 01/04/2012 how to get days of month > Nandkishor V. Lande > for ex. client enter date 17/05/2012 i want next date 31/05/2012 is it possible. > > Hi, * --- GetLastDate.prg * --- Pass the date off to this UDF in a date format. * --- ie: ldToday = DATE() * --- ldLastDate = GetLastDate(ldToday) * --- Syntax: ldEndDate = GetLastDate() PARAMETERS ldDate RETURN GOMONTH(ldDate-DAY(ldDate)+1,1)-1 Pete "the IceMan", from the Great White North of Canada. www.marathongriffincomputers.com if nkeycode=13 local ccmonth m.ccmonth=MONTH(thisform.ntext3.value) DO form st_preg1 with m.ccmonth ENDIF

RE: month days?
Thread ID: 353748 David Mustakim RE: month days? > > Hi, * --- GetLastDate.prg * --- Pass the date off to this UDF in a date format. * --- ie: ldToday = DATE() * --- ldLastDate = GetLastDate(ldToday) * --- Syntax: ldEndDate = GetLastDate() PARAMETERS ldDate RETURN GOMONTH(ldDate-DAY(ldDate)+1,1)-1 Pete "the IceMan", from the Great White North of Canada. www.marathongriffincomputers.com > > if nkeycode=13 local ccmonth m.ccmonth=MONTH(thisform.ntext3.value) DO form st_preg1 with m.ccmonth ENDIF 1. Make sure that the month name string eg. "April" or "May" is not entered manually (use CMONTH()) then you could write (yourself, lol) some DEFINE statement to make

RE: month days?
Thread ID: 353748 Nandkishor Lande RE: month days? > > if nkeycode=13 local ccmonth m.ccmonth=MONTH(thisform.ntext3.value) DO form st_preg1 with m.ccmonth ENDIF > > 1. Make sure that the month name string eg. "April" or "May" is not entered manually (use CMONTH()) then you could write (yourself, lol) some DEFINE statement to make it as integer 4 or 5 (then use it below as the "nMonth") > 2. Enter programmatically your two textboxes as FROM "DATE(nYear,nMonth,1)" TO "DATE(nYear,nMonth,nnn)" Oops.. for nnn your have to figure this out whether 28,29,30 or 31 based on technique with GOMONTH() above. > HAPPY CODING, ALL THE BEST ! Problem is solved with replacing fields Thanks

RE: More Grids... Got Focus/Lost Focus
control keypress() this.parent.parent.keypress(nKeyCode, nShiftAltCtrl) -- Eric den Doop www.foxite.com - The Home Of The Visual FoxPro Experts

RE: Mouse Wheel in DropDown List
PROCEDURE lstDates.Init THIS.Visible = .F. * set up data FOR lnCount = 1 TO 300 THIS.AddItem(TRANSFORM(DATE()+lnCount, "YL")) ENDFOR ENDPROC PROCEDURE lstDates.KeyPress LPARAMETERS nKeyCode, nShiftAltCtrl #DEFINE kENTER 13 IF nKeyCode = kENTER THIS.Click() ENDIF ENDPROC PROCEDURE lstDates.LostFocus THIS.Visible = .F. ENDPROC
MouseWheel on listbox works fine... This may not be all

RE: Mouse Wheel in DropDown List - REVISITED
ENDPROC > PROCEDURE KEYPRESS LPARAMETERS nKeyCode, nShiftAltCtrl > WITH THIS.PARENT.PARENT.PARENT > LOCAL here DO CASE CASE nKeyCode = 27 && ESC .Result = .LastSelection .QUERYUNLOAD() CASE nKeyCode = 13 && ENTER .Result = cgCursor.cgItem .QUERYUNLOAD() CASE nKeyCode = 7 && DEL DELETE IN "cgCursor" .Grid1.REFRESH() CASE nKeyCode = 22 && INS here = RECNO("cgCursor


Result Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74