473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to stop an autoscroll event on a panel?

Hello,
I have a problem with getting an autoscrollbar to end up where I want it.
Things to know about the prob:
I have an imagebox inside of a Panel for (inheritance of) autoscroll capabilities. The imagebox is named panel2 for my own conventions and the panel will be named panel1
Panel2 (the imagebox) is set to fit to the size of Panel1 (the Panel). All of this works great...
I have broken up an extremely large image (width wise, not mem size) that is to large for autoscroll to handle which caused my prog to crash.
The original image (the really big one)will be called bmp_temp.
Each of these smaller image pieces I will call testimage0, testimage1, etc. and will save them to myBmp.
I have set the following:
panel1.AutoScrollMargin = bmp_temp.Size;
panel2.Image = myBmp;
Also assume that panel1.autoscroll = true;

//If I reach the end of the first image...
if (-x_scroll_val >= (this.panel2.Image.Width))
{

// Load the next image.
Bitmap myBmp = new Bitmap(@"c:\Docume..... //yes this retrieves the next image (testimage1) just fine.
panel2.Image = myBmp;

//somewhere here is the problem????????
this.panel1.AutoScrollOffset = new Point(-myBmp.Width, 0);
this.panel1.AutoScrollPosition = new Point(myBmp.Width , 0);
this.panel2.Location = new Point(0, 0);
}


Problem:
When I reach a certain point on the first image (testimage0, which you can assume was preloaded and autoscroll works just fine on it), I want to be able to load the next image (for example testimage1) and have the autoscroll be at the same place I left off at. I assumed this has something to do with autoscrolloffset but whenever I use this small lump of code, the new image is placed in the proper place and the autoscroll is in the correct position but it will not allow me to scroll the new image. Do you have any ideas on this?

So... I also have now tried ScrollControlIntoView which brings the autoscroll bar position back to zero... Again I want it to be at where the last image had ended (therefore) at the beginning of the second image. The rest of my program (an event analyzer) is dependent on these autoscroll positions. I can not use regular scrollbars.

Any Ideas Would be awesome!!!
Oct 11 '06 #1
0 2862

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

Similar topics

12
by: NewSun | last post by:
I draw a grid on a panel.And panel1' property AutoScroll is set true.When HScroollBar is Scroolling,the grid is error. I have rewritten the mathod of WndProc.But the effect is unexpected. How can...
1
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. ...
0
by: amit bharadwaj | last post by:
hi all am using a panel , now i want to programitally set the thumb of autoscroll. for tht i have override wndproc() and try to set it .. ant it does .. but after that autoscroll too modify...
2
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the...
1
by: Chris Morse | last post by:
I'm trying to figure out how to get Panel to autoscroll a picturebox that changes size. Initially, the picture box is the same size as the panel, but when I add a "zoom" function that doubles the...
0
by: 23s | last post by:
I have 2 rich textboxes within an auto-scrolling panel object. The textboxes aren't wider than the panel, so it never scrolls horizontally. But the combined height of both textboxes is taller than...
5
by: Frank | last post by:
Hello, if autoscroll is true in a form. Is there a way to detect the scrollbars are active? Thanks Frank
3
by: Tom Bianchi | last post by:
Hi, I have a Panel with the AutoScroll property set to True and many TextBoxes into it, with only some of them positioned in the visible portion of the panel. Is there a Panel event that I can...
0
by: Neeraj | last post by:
Hi I have panel and inside the panel i have many picturebox,if number of picturebox increase ,i have set panel's autoscroll property to true,but as and when i click on any of the picturebox ,i...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.