Author Topic: cursor di text box tidak pindah saat backspace  (Read 745 times)

0 Members and 1 Guest are viewing this topic.

Offline cgunawan

  • Newbie
  • *
  • Posts: 15
cursor di text box tidak pindah saat backspace
« on: February 27, 2018, 09:34:27 AM »
Pagi Rekan2 VFP,

saya mau tnya nih
sy ada 4 text box - text1, text2, text3, text4

jika posisi cursor ada di text3 : kemudian sy ketik/inpt sesuatu... lalu sy tekan tombol backspace (tanpa di lepas) kenapa cursor bisa pindah ke text2, text1, dst nya

bagaimana cara ny spy saat tekan tombol backspace. cursor akan mentok di posisi awal dr textbox tsb sj?
mohon pencerahan nya
Thanks & Regards,
Christian

Offline doditasik

  • Full Member
  • *
  • Posts: 83
Re: cursor di text box tidak pindah saat backspace
« Reply #1 on: February 27, 2018, 11:32:45 AM »
pasang pada methode keypress

 do case
     case keypress = BACK_SPACE
 
        If cursor-pointer sampai batas awal

               hey..cursor diem lu disitu..jgn ke mana..mana

        else
             .....next cursor
       endif
.....
.....

Offline cgunawan

  • Newbie
  • *
  • Posts: 15
Re: cursor di text box tidak pindah saat backspace
« Reply #2 on: February 27, 2018, 11:47:28 AM »
Thanks atas info nya.
sy barusan sd ktmu jg solusi nya. di form properti "TABSTOP" di set False.


Offline sinyonamakoe

  • Global Moderator
  • Hero Member
  • *
  • Posts: 1.198
Re: cursor di text box tidak pindah saat backspace
« Reply #3 on: March 22, 2018, 05:09:33 PM »
Thanks atas info nya.
sy barusan sd ktmu jg solusi nya. di form properti "TABSTOP" di set False.

Jika property TABSTOP = .F., maka control tersebut akan selalu dilewati oleh cursor, ga bisa otomatis fokus dengan semestinya. saya lebih rekomen pake kode dibawah ini :

Code: Text
  1. * TextBox Keypress
  2. LPARAMETERS nKeyCode, nShiftAltCtrl
  3. IF nKeyCode = 127 AND This.SelStart = 0 AND This.SelLength = 0
  4.         NODEFAULT
  5. ENDIF
  6.  

source : https://www.berezniker.com/content/pages/visual-foxpro/preventing-backspace-key-textbox-moving-cursor-previous-control

Offline armen_sakti

  • Fox-id M.V.P
  • Hero Member
  • *
  • Posts: 1.254
Re: cursor di text box tidak pindah saat backspace
« Reply #4 on: August 14, 2018, 08:18:31 AM »
Hallo mas sinyo apa kabar ?

Offline foxy

  • Fox-id M.V.P
  • Hero Member
  • *
  • Posts: 3.605
    • Foxy Land
Re: cursor di text box tidak pindah saat backspace
« Reply #5 on: August 19, 2018, 08:20:03 PM »
Hallo mas sinyo apa kabar ?

halo bang armen ;-) lamo tak basuo... baa kaba?
This post is provided as is. Feel free to use all the codes and information, however understand that I don't have any obligations to fix any bug(s) or follow up this subject.