Cloning controls

skip control sets entirely (unless there s something specific you need / want from the control set config)

  1. new application (this is an API 2.0 desktop application)
  2. add a method to Window1
Private Sub paintcontrol(instance as desktopcanvas, g as graphics, areas() as rect)
  g.DrawingColor = &cff0000
  g.fillrect 0,0, g.width, g.height
End Sub
  1. in Window1 add opening event
  2. place this code in there
Dim c As New desktopcanvas

c.visible = True = 100
c.Left = 100
c.width =  100
c.height = 100

AddHandler c.paint, AddressOf paintcontrol

Self.AddControl c


creates and adds the new control and the pain method handles painting it