Use below code to enable or Disable all controls on a window in PowerBuilder. You can customize this one accordingly.
int li_counter DataWindow ldw_DataWindow CommandButton lcb_CommandButton StaticText lst_StaticText singleLineEdit ls_singleLineEdit checkbox lcb_checkbox picturebutton lpb_picturebutton editmask lem_editmask dropdownlistbox lddlb_dropdownlistbox userObject luo_userobject radioButton lrb_radiobutton groupBox lgb_groupBox for li_counter = 1 to upperbound(control[] ) choose case TypeOf(this.control[li_counter]) case DataWindow! ldw_DataWindow = this.control[li_counter] ldw_DataWindow.enabled = false case CommandButton! if this.control[li_counter].classname() <> 'cb_cancel' then lcb_CommandButton = this.control[li_counter] lcb_CommandButton.enabled = false end if case StaticText! lst_StaticText = this.control[li_counter] lst_StaticText.enabled = false lst_StaticText.textColor= 134217745 //Disabled Text Color case singleLineEdit! ls_singleLineEdit = this.control[li_counter] ls_singleLineEdit.enabled = false case checkbox! lcb_checkbox = this.control[li_counter] lcb_checkbox.enabled = false case picturebutton! lpb_picturebutton = this.control[li_counter] lpb_picturebutton.enabled = false case editmask! lem_editmask = this.control[li_counter] lem_editmask.enabled = false case dropdownlistbox! lddlb_dropdownlistbox = this.control[li_counter] lddlb_dropdownlistbox.enabled = false case userobject! luo_userobject = this.control[li_counter] luo_userobject.enabled = false case radiobutton! lrb_radiobutton = this.control[li_counter] lrb_radiobutton.enabled = false case groupbox! lgb_groupBox = this.control[li_counter] lgb_groupBox.enabled = false lgb_groupBox.textcolor = 134217745 end choose next
Please notify me the replies via email.
Have a question about IT career progression or transition?
Get suggestions and ideas from the IT community.
Ask a question