472,802 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,802 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 2840

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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.