473,799 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Panel set to autoscroll is too limited

!NoItAll
297 Contributor
I am using a panel control in vb.net (2010) to build a timeline of images. These are very small images (320x180) and I am running into a limit of 240. While the panel does not complain when I add more - it will only scroll to the 240th one.
Here is what my timeline looks like:

mouse-over to see the whole thing...

My question is: Any ideas on how I can do this? I am counting on some of the built-in functionality of the panel in autoscroll mode (being able to bring any of the thumbnails into view), etc. I am certainly not averse to purchasing a third party control for this. I really need to be able to display 1000 or more thumbnails!
p.s. the image itself is hosted in a small custom control that I made... perhaps this just uses too much memory...??
Oct 7 '11 #1
3 4155
Rabbit
12,516 Recognized Expert Moderator MVP
You could use a paging type solution instead of a scroll.
Oct 7 '11 #2
!NoItAll
297 Contributor
Hmmm - that actually makes me think the problem may be a limit on the width of the window rather than anything else. Your suggesting may work if I just add another row below the current one. The normal user metaphor for this kind of thing is a left-to-right timeline, but a real timeline doesn't typically show every frame so some deviation from that might be appropriate...
But - just in case, does anyone know about a 3rd party control that might do the trick?
Oct 7 '11 #3
!NoItAll
297 Contributor
Ok - found the answer. The problem is that the panel control will not allow you to set the .left value of any child objects to anything greater than 32767 (short). I have no idea why this is. If you set it to anything larger it will just ignore you and reset it to 32767. So as I built my timeline all of my thumbnail windows that needed to go beyond a .left of 32767 were getting plopped on top of each other.
The answer was to NOT use the panel control, but to create my own container made of system.windows. forms.form. It required a little setup, but that was relatively easy and straight-forward. Here is a test harness I created to make it work:
Expand|Select|Wrap|Line Numbers
  1. Imports WXC
  2. Public Class Form1
  3.     Private WinHost As New System.Windows.Forms.Form
  4.     Private tWin() As WXC.ThumbnailWindow
  5.  
  6.  
  7.     Private Sub MakeTimeline()
  8.  
  9.         'size and position the host window
  10.  
  11.         With WinHost
  12.             .TopLevel = False
  13.             .Visible = False
  14.             .Parent = Me
  15.             .Left = pnltl.Left + 2
  16.             .Top = pnltl.Top + 2
  17.             .Height = pnltl.Height - 4
  18.             .Width = pnltl.Width - 4
  19.             .BackColor = Color.DimGray
  20.             .FormBorderStyle = Windows.Forms.FormBorderStyle.None
  21.             .Cursor = Cursors.Hand
  22.             .AutoScroll = True
  23.         End With
  24.  
  25.         ReDim tWin(800)
  26.  
  27.         WinHost.SuspendLayout()
  28.         For I = 0 To UBound(tWin)
  29.             tWin(I) = New ThumbnailWindow(My.Resources.Axis_320x180_6034e_thumb, String.Empty)
  30.             tWin(I).Parent = WinHost
  31.             tWin(I).Picture = My.Resources.Axis_320x180_6034e_thumb
  32.             tWin(I).Location = New System.Drawing.Point((I * 128) + 3, 2)
  33.             tWin(I).DayAndTime = I.ToString & " " & tWin(I).Left.ToString
  34.             WinHost.Controls.Add(tWin(I))
  35.         Next
  36.         WinHost.ResumeLayout()
  37.         WinHost.Refresh()
  38.         WinHost.BringToFront()
  39.         WinHost.Visible = True
  40.         MsgBox("Done")
  41.  
  42.     End Sub
  43.  
  44.     Private Sub btnMakePanels_Click(sender As System.Object, e As System.EventArgs) Handles btnMakePanels.Click
  45.         MakeTimeline()
  46.     End Sub
  47.  
  48.     Private Sub btnBegin_Click(sender As System.Object, e As System.EventArgs) Handles btnBegin.Click
  49.         With WinHost
  50.             .ScrollControlIntoView(tWin(0))
  51.         End With
  52.     End Sub
  53.  
  54.     Private Sub btnEnd_Click(sender As System.Object, e As System.EventArgs) Handles btnEnd.Click
  55.         WinHost.ScrollControlIntoView(tWin(UBound(tWin)))
  56.     End Sub
  57. End Class
  58.  
The wxc.thumbnailwi ndow object is a simple custom control that I made. Sorry I can't share it here because it is the IP of my employer - suffice to say it is just a very simple control made up of a panel, a picturebox and a label. I created this for simplicity. You could make the same thing without creating a custom control.
The only problem I run into now is that there is a limit to the number of Handles Windows will allow (~2000) - but I'm not worried about that limit for my application.
I should also explain that pnltl is a panel control that I put on the form as a placeholder for the new control (the one made from system.forms.fo rm). I did this so there isn't a big empty space to stare at before the timeline is made. It also provides the dimensions and a pretty border for my final control.
The result is great and looks exactly the way I want. There are also plenty of scroll events and methods to give me programatic control.

float mouse over image to see the whole thing
The thumbnails above each show the thumbnail number and the .left property - so you can see it goes well above the 32767 allowed by the wimpy panel control.
Yay.
Oct 8 '11 #4

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

Similar topics

1
1652
by: Marco | last post by:
I need to set the SmallChange property of a scrollbar of a panel (AutoScroll = true), but I don´t see how to acess it. Any help ? _____ Marco
0
1080
by: Marco Rego | last post by:
I need to set the SmallChange property of the VScrollbar of a Panel (AutoScroll = true), but I don´t see how to access it. Thanx for any help and God bless. _____ Marco
2
5180
by: newsgroper | last post by:
I set the AutoScroll property of a windows panel to true. How can I tell when the scrollbar becomes visible?
1
9367
by: John | last post by:
I'm trying to use the DrawText() method to draw some very long string text on the Panel with AutoScroll enabled. However, for some unknown reasons, I could not trigger the ScrollBar to show up. Here is the simplicied section of drawing code: private void panel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { panel.AutoScroll = true;
0
1333
by: Tom | last post by:
I have a panel that is set for autoscrolling, however I -DON'T- want the scrollbars to show up. Do anyone know of any way to make a panel autoscroll and yet have no scrollbars? I know that is an odd request but trust me, it is what I need to do in this screwyapplications case :-) Basically, I am keeping this panel synced with another panel (that the user does scroll) and therefore need to scroll the panel programatically. Thanks. Tom
1
9523
by: Kent | last post by:
Hi, I have a form which contain 2 panels, Master and Detail, Master panel is on top and Detail panel is at the bottom. In the form, I set Detail panel to Dock to the bottom and Master panel Dock to fill. As a result, when I do form resize, Detail's height always retain whereas Master height change base on form size. What I want to do now is I want to set a minimum size for the form, so that if the form got resize small than certain...
2
4836
by: YYZ | last post by:
I discovered something very interesting today, and it will save me a bunch of time...maybe. If you set Panel1.Autoscroll to true, and have a panel2 inside of it, I can add all sorts of controls at runtime, and panel1 will develop scrollbars to take all of this into account. Except for 1 little really annoying feature. When it displays vertical scrollbar (which is good), that space that is taken up by the vertical scrollbar now makes...
4
10562
by: Thiru .Net | last post by:
hi wagner, i have a doubt in panel control in windows application. i have a panel control wherein i have put a picturebox control. i show picture into picturbox control. now i need to zoom in and zoom out the picture in the picturebox control. the picturebox control is within panel(autoscroll is enabled true) scroll bars are enabled.
7
18218
by: Sharon | last post by:
I’m using the Panel control that contains a PictureBox control (for implementing the http://www.codeproject.com/cs/miscctrl/PictureBox.asp). The Panel is set to AutoScroll = true. I wish to scroll the appearing vertical and horizontal scrolls bars of the Panel to the middle of their scrolling range so the contained PictureBox will be centered inside the Panel. But I could not find a way to get the scrolls bars for doing that.
4
4690
by: mateusz.zajakala | last post by:
Hi, I have panel (with autoscroll property) on which I'm dynamicaly adding of controls. When I want to scroll my panel using scrollbars it freezes all the controls added on that panel, makes them nasty stretch. Is there any way to prevent that stretch, and scroll panel smoothly? I tried to add DoEvents() to Scroll event of my panel, which prevent
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10488
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10029
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7567
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6808
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
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 we have to send another system
3
2941
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.