Advanced PowerBuilder

HomePrevious Lesson: User Object Level Function uf_initialize
Next Lesson: Code For the CommandButton

Code For The DataWindow Control

Write the following code for the Clicked event of the dw_left control:
// Object: DW_left in uo_shuffle_rows_between_2_dws
// Event: Clicked
If Row > 0 Then
   cb_transfer_to_right.Enabled = TRUE
Else
   cb_transfer_to_right.Enabled = FALSE
End If

This simply checks if any rows are selected in the control and enables or disables the cb_transfer_to_right CommandButton accordingly. The logic for the other DataWindow control is exactly the same.

The script for both the DataWindows are identical, so, we can implement the script in a function and distinguish between them by passing relevant parameters and then call it from both the DataWindows.
HomePrevious Lesson: User Object Level Function uf_initialize
Next Lesson: Code For the CommandButton