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
c.top = 100
c.Left = 100
c.width =  100
c.height = 100

AddHandler c.paint, AddressOf paintcontrol

Self.AddControl c

run

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