473,394 Members | 2,020 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,394 software developers and data experts.

Panel control resets its scroll position

I'm writing an application whose main window consists of a particular
UserControl that I have placed inside a docked Panel so that it will
fill the whole window. The panel also has the AutoScroll property set
so that the user can scroll if the inner control is larger than the
window.

Various dialogue boxes (displayed with Form.ShowDialog(this)) are
available for setting properties, etc., and I've noticed that when a
dialogue box is closed, the panel immediately reverts back to its top
left-hand corner, forgetting where the user had scrolled.

I can probably work around this by saving and restoring the scroll
position, but is this a known bug or some feature of the Panel that
I'm overlooking? It's definitely not my code.

Eq.
May 28 '06 #1
2 7546
"Paul E Collins" <fi******************@CL4.org> wrote in message
news:D6******************************@bt.com...
I'm writing an application whose main window consists of a particular
UserControl that I have placed inside a docked Panel so that it will fill
the whole window. The panel also has the AutoScroll property set so that
the user can scroll if the inner control is larger than the window.

Various dialogue boxes (displayed with Form.ShowDialog(this)) are
available for setting properties, etc., and I've noticed that when a
dialogue box is closed, the panel immediately reverts back to its top
left-hand corner, forgetting where the user had scrolled.

I can probably work around this by saving and restoring the scroll
position, but is this a known bug or some feature of the Panel that I'm
overlooking? It's definitely not my code.


Not sure if it's the same problem, but I've noticed that if the user scrolls
a form/panel so that the active control is not fully visible then when the
form regains focus after losing it (whether because another form is shown,
or because the user switches away to another application), the form/panel
scrolls to make the active control visible. Unfortunately I can't find any
simple way to prevent this.

Chris Jobson
May 28 '06 #2
I found exactly the same problem, if you save the scroll positions before
calling the dialog box. Then after the dialog is closed set the scroll
positions back to their original positions, you will stop the contents of the
panel moving, but the scroll bar(s) are to the left/top i.e. they do not
match the contents.

"Paul E Collins" wrote:
I'm writing an application whose main window consists of a particular
UserControl that I have placed inside a docked Panel so that it will
fill the whole window. The panel also has the AutoScroll property set
so that the user can scroll if the inner control is larger than the
window.

Various dialogue boxes (displayed with Form.ShowDialog(this)) are
available for setting properties, etc., and I've noticed that when a
dialogue box is closed, the panel immediately reverts back to its top
left-hand corner, forgetting where the user had scrolled.

I can probably work around this by saving and restoring the scroll
position, but is this a known bug or some feature of the Panel that
I'm overlooking? It's definitely not my code.

Eq.

May 29 '06 #3

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

Similar topics

3
by: rmunson8 | last post by:
I have added Panel control to a web page which contains a GridView. The Panel's ScrollBars property is set to auto. When I select the Select CommanField button for a row (which obviously causes a...
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: bhaskerr | last post by:
Hi, The panel has a scrollbar and I want add a control to the panel at some location dynamically. How do I find the relative location within the panel when the panel has scroll bars. Normally I...
12
by: Peter | last post by:
Using .NET 1.1 Window Forms I would like to place over 400 pictures on a panel control one after another one so user can scroll through them, but each picture is up to 200 pixels in height...
1
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I've panel in my windows form, and i want to get the exact mouse position when i double click. I used: Point p = this.panel1.PointToClient(Cursor.Position); but now, if i'm pointing on...
0
by: canteloup | last post by:
Hi, I need to find a way to determinate where a control is on a windows form or panel control. I have a panel contro setted with autoscroll = true and when I move a control contained by it, I need to...
0
by: Sobin | last post by:
I am new to ASP .NET. In my webpage there is a panel with vertical scroll bar enabled.Inside the panel there is a treeview control.I'm populating its nodes at run time through database...
1
by: =?Utf-8?B?TmV3YnJv?= | last post by:
I have this program running on PDA compact framework in which it will receive paint message from server's networkstream and updates the client's screen by drawing on this custom 'Draw' userControl....
2
by: kulabhishek | last post by:
Hello all. I have developed one user control "Grid" in C# and I am using it in another user control inside one panel. The AutoScroll property for the panel is enabled. When the height or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.