¸ÕÀú userevent¸¦ ¸¸µì´Ï´Ù.
user eventÀÇ À̸§Àº keydown, argument´Â pbm_dwnkey·Î ÇÕ´Ï´Ù.
±×¸®°í ´ÙÀ½ÀÇ ½ºÅ©¸³Æ®¸¦ dwÀÇ keydown¿¡ ³Ö½À´Ï´Ù.
¾Æ·¡ÀÇ ¼Ò½º´Â ÇÔ¼ö¿ÍºÎ event script·Î ³ª´©¾îÁ® ÀÖ´ø°Çµ¥ °Á¦·Î ºÙ¿© ³õ¾Æ¼
º¸±â´Â º°·Î ¾È ÁÁÀºµ¥ Á¤È®È÷ µ¿ÀÛÀº ÇÕ´Ï´Ù.
//------------------------------------------------------------------------------
integer KeyID
long rc, rn, fr, lr, sz, sp
// ÀÛ¾÷°ÅºÎ
if row = 0 then return
if rowcount() = 0 then return
if key = KeyEnter! then return
// KeyID
Choose case key
case KeyUpArrow! ;KeyID=01
case KeyDownArrow!;KeyID=02
case KeyPageUp! ;KeyID=03
case KeyPageDown! ;KeyID=04
case KeyHome! ;KeyID=05
case KeyEnd! ;KeyID=06
case KeyInsert! ;KeyID=07
case KeyDelete! ;KeyID=08
case KeyEscape! ;KeyID=09
end Choose
// º¯¼ö ÃʱâÈ
rc = RowCount()
rn = GetSelectedRow(0)
fr = Long(Describe("DataWindow.FirstRowOnPage"))
lr = Long(Describe("DataWindow.LastRowOnPage" ))
sz = lr - fr
Choose case KeyID
case 1
if rn > 1 then sp = rn - 1 else sp = rn
case 2
if rc > rn then sp = rn + 1 else sp = rn
case 3
if fr > rn then rn = fr
sp = fr - sz - 1
if sp < 1 then sp = 1
case 4
if rn < lr then rn = lr
sp = rn + sz + 1
if sp > rc then sp = rc
case 5
sp = 1
ScrollToRow(sp)
case 6
sp = rc
ScrollToRow(sp)
case 8
DeleteRow(row)
end Choose
SelectRow(0, False)
SelectRow(sp, True) |