Karl,
The only thing that I think is wrong with this code is that you are still using an array.
Why not make it a List<System.Windows.Forms.Control> and why not use foreach to enumerate the list?
The array takes more memory than the List<>. The controls are stored in a usual and in the loop the controls are extracted from the usual, which at least requires a type check to see if the usual is indeed an object. Also, the runtime then has to check to see that the object returned from the usual is indeed a control.
If you declare the list like I suggested, then you can be certain that each element is a control.
FYI, the array class already uses a List<>, but that is a List<USUAL>.
Robert
Robert
DotNet Controls
DotNet Controls
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
DotNet Controls
Hi Robert,
of course you are right, but right now if i do tests I'm still quicker with old VO-style.
I'll change that right now...
Karl
of course you are right, but right now if i do tests I'm still quicker with old VO-style.
I'll change that right now...
Karl
DotNet Controls
Hi Karl,
Ah, OK, I just thought a container control (I had been using a CustomControl from the VO toolbox) that has the winform control inside it makes things simpler with positioning it on the window, also makes it easier to have a visual clue in the window editor as to how it will look (position wise) at runtime. But especially with a toolstrip I guess indeed it makes more sense to put directly on the window.
Ah, OK, I just thought a container control (I had been using a CustomControl from the VO toolbox) that has the winform control inside it makes things simpler with positioning it on the window, also makes it easier to have a visual clue in the window editor as to how it will look (position wise) at runtime. But especially with a toolstrip I guess indeed it makes more sense to put directly on the window.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu