Create Button Dynamically

How to create multiple button dynamically and add it to window ?

See http://documentation.xojo.com/index.php/New

while i am trying the Button

Dim pb As PushButton
pb=New pushbutton1
pb.caption=“Clone”
pb.Left=Me.Left+Me.Width+10

it shows error in 2nd line , (pushbutton1)

[quote=240475:@Satyajit Rath]while i am trying the Button

Dim pb As PushButton
pb=New pushbutton1
pb.caption=“Clone”
pb.Left=Me.Left+Me.Width+10

it shows error in 2nd line , (pushbutton1)[/quote]

PushButton must exist. Make PushButton1 a control set before running this. Click in the gear icon on top of the inspector, and go Member of a new control set.