473,473 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can't get more than 10000 controls in a panel

ThatThatGuy
449 Recognized Expert Contributor
This is an unsual and weird problem that im facing....

Im developing a ticketing software where ....

At runtime when i try to add more than 10000 labels in the panel for seat layouts...

the program raises a Win32 unhandled exception...
Nov 18 '09 #1
16 5996
Plater
7,872 Recognized Expert Expert
You may have surpased a hard limit. Can you even fit 10,000 labels on the screen at one time?
Nov 18 '09 #2
tlhintoq
3,525 Recognized Expert Specialist
Does the code work with 100 labels?

Otherwise post the relevant code where the exception occures
Nov 18 '09 #3
ThatThatGuy
449 Recognized Expert Contributor
the application is about seat layouts where....
at runtime the application accepts for the rows and cols for seats and draws...
them according.....

when i enter (90 rows and 90 cols) it draws them on Panel and the panel is scrollable...

but when i do (100 rows and 100 cols) it raises a Win32 exception and the error message displays is "Error creating Handle"....
Nov 19 '09 #4
Plater
7,872 Recognized Expert Expert
Did you run in debug to see where the exception was being thrown at?
Nov 19 '09 #5
GaryTexmo
1,501 Recognized Expert Top Contributor
There's a built in limit to the number of window handles windows will give you. It's supposed to be in a per application basis, but there's some oddness in there. Google around with various keywords, there's some information/discussion you can find.

Also, to play around with this a while back I made a little handle tester. You're welcome to play around with it if you like, but use at your own risk :)

http://members.shaw.ca/gtexmo/Code/C.../HandleTester/
(This is the code so you can see how things were handled, and how my program recovers from the error generated by hitting that control limit. Yea, it really feels like a hack, but it does the job. It was the only way I could find to recover... just trying to clear the panel controls would throw the exception again. I had to null the entire panel and regenerate, which felt really cumbersome.)

To resolve the issue, you have two options...

1) Handle the problem in a different way. You can either draw only the controls you could possibly see on the screen at any given time and then manually deal with scrolling, or you can change your data presentation entirely. I've seen a few suggestions on breaking the data up into categories, then displaying each category as requested. Caching helps with recall and can bump off unused categories to make room for new controls when they need to be allocated.

2) There is a registry entry you can use (again, search google) to bump up the number of window handles Windows will let you use. I'm not exactly sure on the details and I think it's still capped in some way, but it will let you exceed that 10k limit.

Personally, I'd say #1 is a better way to go even though it requires more work. I guess it depends on your deployment and if you can have access to this registry setting on your client machines. Also, ten thousand controls is a lot to process at any one time, breaking it down might increase the usability of your program. Of course, it is a lot easier to just change the registry setting.

Whatever works best for you :)

(Again though, I highly recommend doing some googling. This issue has quite a bit of information on it.)
Nov 19 '09 #6
tlhintoq
3,525 Recognized Expert Specialist
Handling the architecture differently is your best bet. For example: Instead of trying to load 10,000 seats, load 20 sections, then narrow to 1,000 seats per section.

Or load no seats at all: Load a graphic of the areana and calculate what seat was clicked on by mouse location... etc.
Nov 20 '09 #7
ThatThatGuy
449 Recognized Expert Contributor
i dropped the idea of drawing seat layouts with labels and
chose the GDI+ for drawing seat layouts...

thanx for your replies
Nov 20 '09 #8
Studlyami
464 Recognized Expert Contributor
The registry value needed to modify this value is located at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\USERProcessHandleQuota

The limit is at 10000 by default (at least on my PC).

http://msdn.microsoft.com/en-us/libr...86(VS.85).aspx
Nov 20 '09 #9
ThatThatGuy
449 Recognized Expert Contributor
@Studlyami
No Pal..... in my machine the limit was 2710.....
i changed it to 10000 but it didn't worked ......
Nov 21 '09 #10
Studlyami
464 Recognized Expert Contributor
Sorry to hear that. Did you try setting it higher like 15000 or 18000? It sounds like you already have a workable solution, but it would be interesting to know if a higher handle limit fixes the problem.
Nov 23 '09 #11
ThatThatGuy
449 Recognized Expert Contributor
hello.....

Im building a seat layout editor for a ticketing software
Where i need to provide the user to create unlimited or maximum 1.5 crore seats..... as told by my manager....

although it doesn't this application doesn't do well even when i add more than 200,000 seats....

and the seats are all GDI+ ellipses

and the seat layout is a user control and its inside a panel.....

so when the the panel is scrolled it the control happens to repaint.....
and all the seats are painted again.... it creates a slow processs....

and the UI performance is getting worse....

although ive done every thing like i ...... set the styles

this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.Opaque, true);
this.SetStyle(ControlStyles.CacheText, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.UserPaint, true);


still it causes flickering... any answers would be appreciated....
Dec 16 '09 #12
tlhintoq
3,525 Recognized Expert Specialist
Your second post of this question (now with GDI+ ellipse) has been merged with the original thread for this problem.

If you didn't understand in the earlier posts let me try to rephrase:
It is totally unrealistic to add 200,000 controls to a panel. It doesn't matter what kind of controls you try to add whether they are button, picturebox, label, or ellipse. All of these are still derived from the base class of 'control'

Realistically, if this could be done don't you think the large ticket companies would already be doing it? You don't see this type of interface on Ticketmaster for a reason.
Dec 16 '09 #13
ThatThatGuy
449 Recognized Expert Contributor
No..... the fickering has stopped due to user32.dll's LockWindowUpdate API..... and it's working fine with 200,000 .... the gdi+ ellipses do the thing....

But the problem now is can i zoom a part of the user control .... somehow


and i getting this bug for a ruler control when it's width exceeds 32767 px
Dec 16 '09 #14
tlhintoq
3,525 Recognized Expert Specialist
But the problem now is can i zoom a part of the user control .... somehow
So you did all this work... did all that coding for 200,000 ellipses on a panel... built all of this around a usercontrol and panel... Without knowing whether or not a usercontrol could do what you needed it to do (zoom)?

You did no small-scale test? Like draw one small ellipse and see if you could zoom in?

If you have no idea how you are going to fulfill a job contract then don't bid on it.
Dec 16 '09 #15
tlhintoq
3,525 Recognized Expert Specialist
This sounds a lot like CAD program at this point. Drawing 200,000 vector objects.

To zoom you are going to have to figure what percentage of the whole you want to look at... what region of the whole you are looking at... and redraw all the objects within that region at the new scale.

If you zoom in by 50%, then all your objects become twice as big, but you see only half of the total.


Me, I would have tried to do better architecting of the project:
A theater has 3 levels
Level 1 has 20 sections
Section 14 has 10 rows
Row 9 has 8 seats.

Click a level to see the sections (only have to draw 20 objects)
Click a section to see the rows (only have to draw 10 objects)
Click a row to select individual seats (only have to draw 8 objects)

Each Row object has a Thumbnail property (an image)
When you update the status of a row you update the Thumbnail with a red 'X' on that seat.
Each Section has a Thumbnail property made up of the Row thumbnails

When viewing the entire theater you see the Section Thumbnails which tell you if (and how many) empty seats are in the section.
Dec 16 '09 #16
ThatThatGuy
449 Recognized Expert Contributor
Now i dropped the idea .....
of zooming just for some intercativity i asked if we could zoom like windows charmap....

ok thanx for all ur replies...
Dec 17 '09 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET)...
4
by: Tee | last post by:
Hi, Does anyone know how to change an index of an object? This is what I want to do. eg: I have 5 controls in a panel. index from 0 to 4, after I remove the 3rd control (index 2), I want to...
5
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
0
by: mawi | last post by:
Hello, Description: I create panels with some controls on a page using a new panel button. One of the controls on each panel is the "close panel" button that is supposed to close the panel it...
4
by: Bass Pro | last post by:
Hi, I am creating textbox, radiobuttonlist and checkboxlist dynamically depending on data from a table. It is a questionnaire. I add the control on a Panel control during the 1st load_page event....
1
by: Mian Mahboob | last post by:
Nicholas Paldino in my application a have an Windows form on that i place an Panel Control. in Form load event i ganerate an Form in Panel Control on Runtime then get an design time create...
4
by: Mikus Sleiners | last post by:
I can't seem to add new controls to form that is inherited from another form. I have BaseForm wich have table layout on it 2 panelsm and some buttons. Now i create InheritedForm : BaseForm and...
12
by: Adil Akram | last post by:
I'm using VS 2005, .net 2.0 for a desktop application (Window Form app). I can't set ZOrder of Panel control neither at design time by toolbar/menu command "Bring to Front"/"Sent to Back" nor at...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.