MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Iterate through PowerBuilder - Windowcontrols

Published on 31 August 16
1073
0
1
// this example takes a window that contains the following controls
// datawindow,picture control,dropdownlistbox,commandbutton
// I am going to add those objectnames to the dropdownlistbox while opening the //window. However you may change the code as per your wish
// Write the below code in Window open event

int li_objectcount,li_counter
powerobject lpo_object
String ls_lbitemname

li_objectcount=upperbound(this.Control[])

for li_counter=1 to li_objectcount
lpo_object=this.control[li_counter]
if lpo_object.typeof( )=Datawindow! then //Returns the type of the object
ls_lbitemname="Data Window : "+lpo_object.classname( )
// Returns the name of the object
ddlb_1.additem( ls_lbitemname)
elseif lpo_object.typeof( )=picturebutton! then
ls_lbitemname="Picture Button : "+lpo_object.classname( )
ddlb_1.additem( ls_lbitemname)
elseif lpo_object.typeof( )=dropdownlistbox! then
ls_lbitemname="Dropdown ListBox : "+lpo_object.classname( )
ddlb_1.additem( ls_lbitemname)
elseif lpo_object.typeof( )=commandbutton! then
ls_lbitemname="Command Button : "+lpo_object.classname( )
ddlb_1.additem( ls_lbitemname)
end if
next

// Returns the parent name where the objects are placed
ddlb_1.additem("Parent Name : "+lpo_object.getparent( ).classname( ))

// Other object types include
/*
checkbox!, commandbutton!, datawindow!, dropdownlistbox!, graph!, groupbox!, hscrollbar!, listbox!, multilineedit!, editmask!, picture!, picturebutton!, radiobutton!, singlelineedit!, statictext!, userobject!, vscrollbar!, omcontrol!, olecontrol!, treeview!, listview!, tab!, richtextedit!,line!,oval!,rectangle!,roundrectangle!,mdiclient!
*/
And My final Output will be:.

Iterate through PowerBuilder - Windowcontrols - Image 1
// this example takes a window that contains the following controls// datawindow,picture control,dropdownlistbox,commandbutton

// I am going to add those objectnames to the dropdownlistbox while opening the //window. However you may change the code as per your wish

// Write the below code in Window open event

int li_objectcount,li_counter

powerobject lpo_object

String ls_lbitemname

li_objectcount=upperbound(this.Control[])

for li_counter=1 to li_objectcount

lpo_object=this.control[li_counter]

if lpo_object.typeof( )=Datawindow! then //Returns the type of the object

ls_lbitemname="Data Window : "+lpo_object.classname( )

// Returns the name of the object

ddlb_1.additem( ls_lbitemname)

elseif lpo_object.typeof( )=picturebutton! then

ls_lbitemname="Picture Button : "+lpo_object.classname( )

ddlb_1.additem( ls_lbitemname)

elseif lpo_object.typeof( )=dropdownlistbox! then

ls_lbitemname="Dropdown ListBox : "+lpo_object.classname( )

ddlb_1.additem( ls_lbitemname)

elseif lpo_object.typeof( )=commandbutton! then

ls_lbitemname="Command Button : "+lpo_object.classname( )

ddlb_1.additem( ls_lbitemname)

end if

next

// Returns the parent name where the objects are placed

ddlb_1.additem("Parent Name : "+lpo_object.getparent( ).classname( ))

// Other object types include

/*

checkbox!, commandbutton!, datawindow!, dropdownlistbox!, graph!, groupbox!, hscrollbar!, listbox!, multilineedit!, editmask!, picture!, picturebutton!, radiobutton!, singlelineedit!, statictext!, userobject!, vscrollbar!, omcontrol!, olecontrol!, treeview!, listview!, tab!, richtextedit!,line!,oval!,rectangle!,roundrectangle!,mdiclient!

*/

And My final Output will be:.

Iterate through PowerBuilder - Windowcontrols - Image 1

Iterate through PowerBuilder - Windowcontrols - Image 2

Venkatesh Guptha | MyTechLogy

https://www.mytechlogy.com/GupthaJV/

Venkatesh Guptha - A professional development platform for Tech Enthusiasts to share ideas & blogs, learn IT skills, grow knowledge and find jobs or career opportunities.

This blog is listed under Development & Implementations Community

Related Posts:
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
 
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top