Can someone point me in the direction of an example app using the AddControl capability in Desktop? I have the code
where MyButton1 is a simple DesktopButton. It compiles fine and seems to run but where is the new control? How do I reference it to set its location and appearance, to say nothing about handling its events?
Because the controls aren’t based on anything made at design time, the problem is that you need to assign the width and height, otherwise the control is initialised with 0’s and you can’t see it, you keep a reference to it in any other way you keep references to things, an array/dictionary etc.
As the controls aren’t based on anything “real”, they have no meaningful defaults, I’ve yet to fix the background color of added textfield’s as I’ve only played with it for a few minutes while reporting a bug but it was coming out black in windows dark mode as apposed the “correct” background color of a textfield added at design time. Plenty of room for improvement, but its a start and has been sorely missed that you couldn’t just create controls on the fly, they had to be based on something.