Thursday, 20 April 2017

Create Visual Objects Dynamically in PowerBuilder

Yes, We can create and open that Visual User Objects in PowerBuilder at run time. in the following example we are going to see how to create a Picture control at runtime and assigning the image for that Picture Control also.

Code:

 picture p_2 // declare the picture variable 
 p_2 = create picture // create the picture object 
  
 p_2.x = 100 // x position of the object 
 p_2.y = 100 // y position of the object 
 p_2.height = 350 // height value of the object 
 p_2.width = 450 // with value of the object 
 p_2.picturename = "D:\raj\profile.jpg" // name of the picture inc full path 

parent.openuserobject( p_2, "p_2", 100, 100) // ok, let's create the object


Et Voila
Pushparaj

No comments: