Instance variables from the property bag in DrawControlInLayoutEditor

How do I access instance variables from the designer in the DrawControlInLayoutEditor for the Web SDK ?

In the code bellow then it will give me not so friendly Error symbol on the drawn layout because I access the property mLarge

Sub DrawControlInLayoutEditor(g as graphics) Handles DrawControlInLayoutEditor
  const OFFSET_X = 0
  const OFFSET_Y = 0
  const PI = 3.1415926536
  var w as Integer
  var h as Integer
  if mLarge then
    w = 200
    h = 200
    w = 140
    h = 140
  end if
  g.DrawingColor = &c2F3436
  g.FillRoundRectangle(OFFSET_X, OFFSET_Y, w, h, 15, 15)
  g.DrawingColor = &c555753
  g.PenSize = 2
  g.DrawRoundRectangle(OFFSET_X, OFFSET_Y, w, h, 15, 15)
End Sub

Only error I get is that yellow marker here:


Even took me a while to figure out it was the accessing of mLarge that causes it since the picture gives no info at all what is going on.

So what am I doing wrong ? I obviously need to access properties that the programmer has toggled so I can render the selection in the IDE.

I actually found the answer

var isLarge as Boolean = BooleanProperty("Large") 

you can look at the message window, when you have a display error like this
there is the description of the encountered error there.

1 Like