What Control Has The Lowest Resource Usage?

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>

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!

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=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

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=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]

Great help, thanks!