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

Home Posts Topics Members FAQ

Panel-height greater Int16.MaxValue?

Hi folks,

I'm have a user-control that imitates a thumbnail-listview. Within, I have
a panel (pnlOuter) that represents the viewable area and another panel
(pnlInner) which represents the list as a whole with a scrollbar that'll
enable the user to change the viewable area.
Hence, pnlInner will grow in vertical size once more items are added to the
list than may fit into pnlOuter (being the viewable area).

When checking the behaviour with a large list of items though I had to find
out that a panel's height may not exceed 32767 pixels (= int16.MaxValue).
No exception will be risen, but the control just won't grow anymore.
Thus, if any items are added that would require pnlInner to be larger than
this max-value, they may never be seen/scrolled to.
The same also applies to a user-control itself - no way to enlarge it above
32767px!

Is there any way to further enlarge a control? Virtually, the panel would
have to be able to have an infinite height really, but I guess it'd be more
probable that there'd be insufficient memory first.
How would I have to handle resp. create such a large listbox in general?
From Access I know the fact that there may not be more than 65535 items at
a time - is that really connected to the listbox's max. height?

Thanks for any suggestions!

Cheers,
Olaf
Nov 21 '05 #1
3 4889
Olaf,

No, there is no way to increase this limit. It is a limit of the operating
system itself, not just .NET.
However, if you do the math, you will find that even without increasing the
dimensions more you can exceed the memory limit of windows itself. Between
2-4GB for just one control. Before you do all the other things you need to.

When someone asks a question about limits, it is usually due to a
methodology that simply won't work on the proposed scale. This applies here
as well. IMHO, even if you could expand the virtual size of the control and
fill it up, you shouldn't. You should implement a methodology of displaying
only the thumbnails required for the proposed view. It will probably mean
managing the scroll bars as well. To represent where you "should" be in the
list, then only load and display the thumbnails that need to be in the view.

If you think about it in those terms, the panel itself would only "need" to
be actual size. However, I could see where for your convenience you might
want to make it bigger, but only slightly. Basically, only larger by 1 row
of thumbnails.

Hope that made some sense.

Gerald
"Olaf Rabbachin" <Ol*********@IntuiDev.com> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
Hi folks,

I'm have a user-control that imitates a thumbnail-listview. Within, I have
a panel (pnlOuter) that represents the viewable area and another panel
(pnlInner) which represents the list as a whole with a scrollbar that'll
enable the user to change the viewable area.
Hence, pnlInner will grow in vertical size once more items are added to the list than may fit into pnlOuter (being the viewable area).

When checking the behaviour with a large list of items though I had to find out that a panel's height may not exceed 32767 pixels (= int16.MaxValue).
No exception will be risen, but the control just won't grow anymore.
Thus, if any items are added that would require pnlInner to be larger than
this max-value, they may never be seen/scrolled to.
The same also applies to a user-control itself - no way to enlarge it above 32767px!

Is there any way to further enlarge a control? Virtually, the panel would
have to be able to have an infinite height really, but I guess it'd be more probable that there'd be insufficient memory first.
How would I have to handle resp. create such a large listbox in general?
From Access I know the fact that there may not be more than 65535 items at
a time - is that really connected to the listbox's max. height?

Thanks for any suggestions!

Cheers,
Olaf

Nov 21 '05 #2
Hi,

Gerald Hernandez wrote:
If you think about it in those terms, the panel itself would only "need" to
be actual size. However, I could see where for your convenience you might
want to make it bigger, but only slightly. Basically, only larger by 1 row
of thumbnails.

Hope that made some sense.


sure did - thanks! I know I could've done that, but I'm wondering about how
to actually implement that. I guess there'll be lots of implications
concerning speed during scrolling as the items within the list would have
to be rearranged constantly. Also, if I don't have all items in memory, I
would be forced to load the thumbnails while scrolling - that would consume
way too much time as the thumbnails would either have to move from one item
to another or the visible ones would have to be repositioned all the time.
I wonder how this is implemented in Windows resp. WinExplorer itself - it's
blindingly fast and there's just no flickering. Also, although thumbnails
seem to be loaded when you scroll through a large thumbnail-list in
WinExplorer, the items will be there pretty quick, but the thumbnail-images
may come later. But that's limited to "the first view". Once shown, they'll
be there without them having to be loaded again.

That said, I'm not really trying to implement the best, but the fastest way
really. In terms of memory, I had some 2000 items within the list with a
memory-peak below 100MB for the app as a whole. Since my app will be the
only one running on target-systems, that would be just fine ...

Thanks,
Olaf
Nov 21 '05 #3
As I'm sure you figured out, this could be from mildly to very complicated.
You will certainly want to build a thumbnail cache instead of generating
each on the fly and/or discarding them.
If it were me, I'd implement a grid type system.
Determine all the thumbnails you will need up front, then break them into
rows and columns based on the window width and thumbnail width.
Then as part of the cache item, prop it as to whether the thumbnail is valid
yet or not. You could even push a temporary image in there that could be
shown while the thumbnail is being generated, then pop the full image in
it's place when it's done. Kind of Explorer like.
Then build all the thumbnails you need for the current grid items, plus a
small buffer, maybe only 1 row on each side.
Display those. Now you could launch a background thread that continues
building the remaining thumbnails. Hopefully, the user will take a few
moments to look at the thumbnails, giving your background thread time to do
it's job.

Now that you have a grid system, determining your parameters for the scroll
bar is pretty easy. Also, determining which rows should currently be
displayed is pretty easy.

As far as actually scrolling, you could use the chunky method, where each
scroll tick would scroll one entire row. Not the most elegant, but easy to
code. But in the end, you will probably want smooth scrolling. This is when
I would make the panel area larger by one row on each side. When you scroll,
if you are not on a full row boundary, just scroll by the proportion of the
off-screen row you want. When you hit the row boundary, just tick up the
current row counter and redraw them all. If done properly, it will be smooth
and seamless to the user.

Of course, this is just one of many ways it could be done, but I think it
would be a good compromise between speed and memory usage. You are only
displaying and scrolling what you actually need to. Plus, you would have the
full cache of thumbnails available as well.

Gerald

"Olaf Rabbachin" <Ol*********@IntuiDev.com> wrote in message
news:uu**************@TK2MSFTNGP14.phx.gbl...
Hi,

Gerald Hernandez wrote:
If you think about it in those terms, the panel itself would only "need" to be actual size. However, I could see where for your convenience you might want to make it bigger, but only slightly. Basically, only larger by 1 row of thumbnails.

Hope that made some sense.
sure did - thanks! I know I could've done that, but I'm wondering about

how to actually implement that. I guess there'll be lots of implications
concerning speed during scrolling as the items within the list would have
to be rearranged constantly. Also, if I don't have all items in memory, I
would be forced to load the thumbnails while scrolling - that would consume way too much time as the thumbnails would either have to move from one item to another or the visible ones would have to be repositioned all the time.
I wonder how this is implemented in Windows resp. WinExplorer itself - it's blindingly fast and there's just no flickering. Also, although thumbnails
seem to be loaded when you scroll through a large thumbnail-list in
WinExplorer, the items will be there pretty quick, but the thumbnail-images may come later. But that's limited to "the first view". Once shown, they'll be there without them having to be loaded again.

That said, I'm not really trying to implement the best, but the fastest way really. In terms of memory, I had some 2000 items within the list with a
memory-peak below 100MB for the app as a whole. Since my app will be the
only one running on target-systems, that would be just fine ...

Thanks,
Olaf

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Fabrizio | last post by:
Hi, There is any chance to insert a control like a text box in a panel choosing the absolute position? When I try to insert a label , the panel positions the control on a locked position. Thanks...
9
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
2
by: Peteroid | last post by:
When the application I'm working on is run it creates a panel with a Paint event customized to draw primitives (circles, rectangles, etc.), places the panel on a form, and then launches the form....
1
by: clintonG | last post by:
I'm having a problem maintaining state with a Panel control in a MasterPage and I need help thinking through this process. The basic structure of the HTML in the Master looks like this... ...
3
by: John Salerno | last post by:
I'm using the sample code of the file 'simple.py' and trying to make a single window with a panel in it, but I keep getting an error. Here's my code: (I know I might need something else, like a...
10
by: markwalker84 | last post by:
Hello everyone! Got a bit of a problem... Two of the panels on my program contain a number of check boxes. The exact number of which is determined by a pair of variables. I have recently...
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...
3
by: zhaodapu | last post by:
I derived a panel class: public class DeskPanel : System.Windows.Forms.Panel Now I want to use the visual designer to add controls in MyPanel class. But I noticed that the visual designer...
14
by: Adam Sandler | last post by:
I have a class with a method which returns a panel. The panel was not created with the visual editor, I coded it by hand -- because some of the content on the panel can be dynamic and thus I chose...
3
by: Gandalf | last post by:
why when I try to insert gridSizer to a panel which already inside another panel the gridSizer doesn't work? this is the code: panel3= wx.Panel(self, -1, (0, 60), size=(400, 240) ,...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.