# What Control Has The Lowest Resource Usage?

**URL:** <https://forum.xojo.com/t/what-control-has-the-lowest-resource-usage/50619>\
**Category:** General\
**Created:** [October 13, 2019, 8:00am UTC](https://forum.xojo.com/t/what-control-has-the-lowest-resource-usage/50619 "2019-10-13T08:00:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Bombay](https://forum.xojo.com/user_avatar/forum.xojo.com/alex_bombay/32/224_2.png) [@Alex\_Bombay](https://forum.xojo.com/u/Alex_Bombay)\
**Post date:** [October 13, 2019, 8:00am UTC](https://forum.xojo.com/t/what-control-has-the-lowest-resource-usage/50619/1 "2019-10-13T08:00:25Z")

</div>

I just spent quite a while trying to find out why my drag and drop events were not working on my ContainerControls, after looking I found it is a known issue: \<[https://xojo.com/issue/16577](https://xojo.com/issue/16577)\>

While I wait for this to be fixed, I need a control that will accept the drag enter/exit and drop events. I see some people have used the Canvas control but I would guess that it would use quite a few resources. Does anyone know what transparent control is the least resource-intensive? I was thinking rectangle but I am not sure how it works under the hood.

Thanks!

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [October 13, 2019, 8:36am UTC](https://forum.xojo.com/t/what-control-has-the-lowest-resource-usage/50619/2 "2019-10-13T08:36:44Z")

</div>

Why should an empty canvas use many resources? I’m using the workaround myself. In DragEnter and DragExit I set a property DragState and the paint event in the Canvas makes a nice round rectangle during the drag:

[code]if DragState \<\> 0 then

g.PenSize = 3

g.DrawingColor = colors.getWindowBackgroundColorLight  
g.DrawRoundRectangle(1, 1, g.Width, g.Height, 10, 10)

g.DrawingColor = colors.getWindowBackgroundColor  
g.DrawRoundRectangle(0, 0, g.Width - 1, g.Height - 1, 10, 10)

Else  
'don’t draw anything  
end if[/code]

---

<div class="post-metadata">

**Author:** ![Alex\_Bombay](https://forum.xojo.com/user_avatar/forum.xojo.com/alex_bombay/32/224_2.png) [@Alex\_Bombay](https://forum.xojo.com/u/Alex_Bombay)\
**Post date:** [October 13, 2019, 8:47am UTC](https://forum.xojo.com/t/what-control-has-the-lowest-resource-usage/50619/3 "2019-10-13T08:47:51Z")

</div>

[quote=457972:@Beatrix Willius]Why should an empty canvas use many resources? I’m using the workaround myself. In DragEnter and DragExit I set a property DragState and the paint event in the Canvas makes a nice round rectangle during the drag:

[code]if DragState \<\> 0 then

g.PenSize = 3

g.DrawingColor = colors.getWindowBackgroundColorLight  
g.DrawRoundRectangle(1, 1, g.Width, g.Height, 10, 10)

g.DrawingColor = colors.getWindowBackgroundColor  
g.DrawRoundRectangle(0, 0, g.Width - 1, g.Height - 1, 10, 10)

Else  
'don’t draw anything  
end if[/code][/quote]

I assume a blank canvas would use very little resources, however, im going to need quite a few of them so im looking for the best control. I’m not sure if a rectange is actually a canvas that draws a rectangle or a different control that is faster for the UI to draw. I don’t actually need anything to be drawn.

Thanks

---

<div class="post-metadata">

**Author:** ![Javier\_Menéndez](https://forum.xojo.com/user_avatar/forum.xojo.com/javier_men%C3%A9ndez/32/153_2.png) [@Javier\_Menéndez](https://forum.xojo.com/u/Javier_Men%C3%A9ndez)\
**Post date:** [October 13, 2019, 8:56am UTC](https://forum.xojo.com/t/what-control-has-the-lowest-resource-usage/50619/4 "2019-10-13T08:56:36Z")

</div>

Hi Alex,

Maybe this picture can be of help for you. It shows the hierarchy of controls (Desktop). Canvas and Rectangle are both subclasses from the RectControl class.

[https://documentation.xojo.com/File:DesktopControlHierarchy.png](https://documentation.xojo.com/File:DesktopControlHierarchy.png)

---

<div class="post-metadata">

**Author:** ![Alex\_Bombay](https://forum.xojo.com/user_avatar/forum.xojo.com/alex_bombay/32/224_2.png) [@Alex\_Bombay](https://forum.xojo.com/u/Alex_Bombay)\
**Post date:** [October 13, 2019, 9:05am UTC](https://forum.xojo.com/t/what-control-has-the-lowest-resource-usage/50619/5 "2019-10-13T09:05:13Z")

</div>

[quote=457976:@Javier Menéndez]Hi Alex,

Maybe this picture can be of help for you. It shows the hierarchy of controls (Desktop). Canvas and Rectangle are both subclasses from the RectControl class.

[https://documentation.xojo.com/File:DesktopControlHierarchy.png[/quote]](https://documentation.xojo.com/File:DesktopControlHierarchy.png%5B/quote%5D)

Great help, thanks!

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:07pm UTC](https://forum.xojo.com/t/what-control-has-the-lowest-resource-usage/50619/6 "2021-04-29T16:07:24Z")

</div>


