Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a problem to solve...
It seems that the fastest (in development time) solution is to put about 1000 tiny controls on some form. Anybody had some experience with that amount of controls on WinForm or WPF?
I would like to hear about it...
Posted

1 solution

Seriously? Don't, if you can avoid it.
I see two major problems:
1) Using the damn thing. Would you want to try and work out what you are looking at there? even if you put ten control across the form, that's still 100 rows of the things! You are going to get a lot of frustrated users...
2) Naming: is it really going to be quicker for development? When you are going to end up with "button732" and "button841" it's not going to be easy to work out which you meant to be using in your code when you write it, much less when you have to make changes.

Obviously, I don't know you application, but can't you at least group them into repetitive blocks and use UserControls, or tab pages?
 
Share this answer
 
Comments
Kornfeld Eliyahu Peter 4-May-14 3:44am    
1. These are controls that sit on top of an image and invisible until hovered or selected.
2. I already have the loop that computes (finds) the place where those controls should sit, as today I have to decide how to present it...using controls or just drawing rectangles...
OriginalGriff 4-May-14 3:53am    
If all you are doing is "highlighting" parts of an image, or allowing clicks rather than anything complex, I'd go for drawing rectangles: it's going to use a heck of a lot less system resources than individual controls because each individual contoil is a separate system Window - with it's own message loop. WPF would be better than WinForms for separate controls because it uses DirectX for all it's drawing within a single Window, so only one handle is ever involved. But WinForms? Gawd that'll be slow and flickery with 1000 controls on an image!
Kornfeld Eliyahu Peter 4-May-14 4:09am    
My thought was that all the selection thing is better handled by controls, than me to compute all time where I'm. I'm aware of the cost - in resources - of so many controls in WinForm I just have no experience where I should draw the line (I'm mainly a web developer, who things that more than 20 controls on a page is a design problem). And WinForm isn't a request, WPF is good as well...
However I got your point - rectangles with computation in the first place, WPF with a 'maybe' at the second, and not third prize handed out...
Thank you!
OriginalGriff 4-May-14 4:11am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900