iOS Question Drawing line in canvas

Discussion in 'iOS Questions' started by mrossen, Jul 11, 2015.

  1. mrossen

    mrossen Active Member Licensed User


    I am drawing 2 lines on a panel like this,

    Dim CanvasHolder As Canvas
    101010, Panel2.Height - 20Colors.RGB(127,176,0), 1)   
    10, Panel2.Height - 20, Panel2.Width - 20, Panel2.Height - 20Colors.RGB(127,176,0), 1)
    I would like to Draw the 2 line on another 10 panels. Is there a way to do tihs smart without duplicating the code 10 times.

    Another problem is if I ex. have a button on the panel with the lines, the refresh redraws the button so i appars 2 times.

    Is there a way to prevent this or do I have to but the button on another panel,

    Thanks Mogens
  2. Erel

    Erel Administrator Staff Member Licensed User

    Sub DrawLinesOnPanel(pnl As Panel)
    Dim CanvasHolder AsCanvas
     CanvasHolder.Initialize(pnl )
    101010, pnl .Height - 20Colors.RGB(127,176,0), 1
    10, pnl .Height - 20, pnl .Width - 20, pnl .Height - 20Colors.RGB(127,176,0), 1)
    End Sub
    Add another panel to each of the panels and draw on the added panel.