1. Chee Boon Ang
  2. PowerBuilder
  3. Tuesday, 5 March 2019 01:36 AM UTC

Hi All,

 

I have a editable datawindow. I would like to use the left/right arrow to move between columns. 

Currently user need to use the tab key to move to next column. Does anyone have any idea to achieve such behavior ? 

 

Rgds,

Chee Boon

Accepted Answer
Olan Knight Accepted Answer Pending Moderation
  1. Tuesday, 5 March 2019 03:57 AM UTC
  2. PowerBuilder
  3. # Permalink

From an old post:

1) Put code in the KEY event to capture the keystrokes you need.

2) /*
    rdw_dw: reference to the d/w
    ai_keytype : a indicator for the key pressed event.this takes the following values
                         +1 -> KeyRightArrow!
                          -1 -> keyLeftArrow!
                      in the ue_key down for calling
*/
long    ll_colcount,ll_idx
string  ls_column


ll_colcount = long(rdw_dw.Object.DataWindow.Column.Count);
ll_idx         =  rdw_dw.getcolumn()
ll_idx         = ll_idx + ai_keytype

do while (ll_idx < ll_colcount) and (ll_idx > 0)

 ls_column  = rdw_dw.Describe ('#' + String (ll_idx) + '.Name')

 if ( (rdw_dw.Describe (ls_column + '.Visible')= 'Y')   or &
    (rdw_dw.Describe (ls_column + '.Visible')= "1") ) and &
      (long(rdw_dw.Describe(ls_column + '.TabSequence')) > 0) then
 
          rdw_dw.Post SetColumn(ls_column)
          exit

 end if
 ll_idx = ll_idx +ai_keytype

loop

Comment
  1. Chee Boon Ang
  2. Tuesday, 5 March 2019 07:12 AM UTC
Thanks you.

I got it...
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.