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 1828 for nkeycode. (0.6084039 seconds)


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

RE: Mouse Wheel in DropDown List - REVISITED
= cgCursor.cgItem .QUERYUNLOAD() > ENDWITH 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

RE: Mouse Wheel in DropDown List - REVISITED
= 14 READONLY = .T. PROCEDURE CLICK WITH THIS.PARENT.PARENT.PARENT .Result = cgCursor.cgItem .QUERYUNLOAD() ENDWITH 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

RE: Mouse Wheel in DropDown List - REVISITED
KEYPRESS LPARAMETERS nKeyCode, nShiftAltCtrl WITH THIS.PARENT.PARENT.PARENT LOCAL here DO CASE CASE nKeyCode = 27 && ESC .Result = .LastSelection here = .lastrecno GO MIN(MAX(1,here),RECCOUNT("cgCursor")) IN "cgCursor" .QUERYUNLOAD() CASE nKeyCode = 13 && ENTER .Result = TRIM(cgCursor.cgItem_) .lastrecno = RECNO("cgCursor") .QUERYUNLOAD() CASE nKeyCode = 7 && DEL .oCombo.REMOVEITEM

RE: Move objects at runtime with keyboard
, ; Width = 100, Caption = "Movable Button" PROCEDURE theControl.KeyPress(nKeyCode, nShiftAltCtrl) DO CASE CASE m.nKeyCode = 5 && up arrow This.Top = This.Top - 1 CASE m.nKeyCode = 24 && down This.Top = This.Top

RE: Moving between Pageframe Pages
Thread ID: 245066 Jun Tangunan RE: Moving between Pageframe Pages I am trying to create a form with PageFrame1 (Page1, Page2). > As there are too many fields in the form, I break them into two pages. > My questions: (1) How to let the user automatically jump to the 1st field of Page 2 when s/he presses the (2) Is there any short cut keys for the user to jump in between Page 1 & Page 2 (without using the mouse)? I believe by last field, you mean a textbox, so in keypress event: LPARAMETERS nKeyCode, nShiftAltCtrl IF nkeycode = 13 this.Parent.Parent.ActivePage = 2 ENDIF You can use lostfocus event so that it will jump

RE: Moving between Pageframe Pages
believe by last field, you mean a textbox, so in keypress event: LPARAMETERS nKeyCode, nShiftAltCtrl IF nkeycode = 13 this.Parent.Parent.ActivePage = 2 ENDIF > You can use lostfocus event so that it will jump...! In my case, the code should be: LPARAMETERS nKeyCode, nShiftAltCtrl IF nkeycode = 13 thisform.pageframe1.ActivePage = 2 ENDIF My second question is that: Is there any short cut keys for the user

RE: Moving between Pageframe Pages
Thread ID: 245066 Jun Tangunan RE: Moving between Pageframe Pages > I believe by last field, you mean a textbox, so in keypress event: LPARAMETERS nKeyCode, nShiftAltCtrl IF nkeycode = 13 this.Parent.Parent.ActivePage = 2 ENDIF > You can use lostfocus event so that it will jump even without pressing Enter but that is it, it will always jump to the next page when it lost its focus. > Jun Tangunan http://weblogs.foxite.com/sandstorm36/ http://www.coderisland.comyour text here > Hi, Jun, > Thank you! It works! > In my case, the code should be: > LPARAMETERS nKeyCode, nShiftAltCtrl > IF nkeycode = 13 thisform.pageframe1.ActivePage = 2 ENDIF


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