# Instance variables from the property bag in DrawControlInLayoutEditor

**URL:** <https://forum.xojo.com/t/instance-variables-from-the-property-bag-in-drawcontrolinlayouteditor/74753>\
**Category:** Web SDK\
**Created:** [March 7, 2023, 1:42pm UTC](https://forum.xojo.com/t/instance-variables-from-the-property-bag-in-drawcontrolinlayouteditor/74753 "2023-03-07T13:42:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Björn\_Eiríksson](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/da6949/32.png) [@Björn\_Eiríksson](https://forum.xojo.com/u/Bj%C3%B6rn_Eir%C3%ADksson)\
**Post date:** [March 7, 2023, 1:42pm UTC](https://forum.xojo.com/t/instance-variables-from-the-property-bag-in-drawcontrolinlayouteditor/74753/1 "2023-03-07T13:42:20Z")

</div>

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

```auto
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
  else
    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:

![image](https://forum.xojo.com/uploads/default/original/2X/3/3def463e2b3e502c8de58a87525d854037530de5.png)

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.

---

<div class="post-metadata">

**Author:** ![Björn\_Eiríksson](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/da6949/32.png) [@Björn\_Eiríksson](https://forum.xojo.com/u/Bj%C3%B6rn_Eir%C3%ADksson)\
**Post date:** [March 7, 2023, 2:02pm UTC](https://forum.xojo.com/t/instance-variables-from-the-property-bag-in-drawcontrolinlayouteditor/74753/2 "2023-03-07T14:02:24Z")

</div>

I actually found the answer

```auto
var isLarge as Boolean = BooleanProperty("Large") 

```

---

<div class="post-metadata">

**Author:** ![Jean-Yves\_Pochez](https://forum.xojo.com/user_avatar/forum.xojo.com/jean-yves_pochez/32/21769_2.png) [@Jean-Yves\_Pochez](https://forum.xojo.com/u/Jean-Yves_Pochez)\
**Post date:** [March 7, 2023, 2:18pm UTC](https://forum.xojo.com/t/instance-variables-from-the-property-bag-in-drawcontrolinlayouteditor/74753/3 "2023-03-07T14:18:01Z")

</div>

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