|
Can I have functionality of programmically AutoScrollPosition for a panel but without actually showing the scroll bar?
Senerio: I have several panels that are programmically set to hor or vertical position controlled by a master panel's scroll bar (not using AutoScrollPosition ).
In order for this to work I need to set AutoScroll = true, which in turns provides a scroll bar. Is there a way to overide the drawing of the Scrollbar of the Panel? Simply turning it to false disables scrolling.
This is an extended question to how do you use one scroll bar of one panel to control the scroll position of other panels.
|
| MigrationUser 1 Wednesday, May 05, 2004 3:37 AM |
sort of update to the question, It seems that Panel itself seems to be designed only to shift to a location ( AutoScrollPosition ) only if a scroll bar is turned on. However Panel is derived by a scrollablecontrol which does include a VSCROLL and HSCROLL taht would disable the viewing the scroll. however it is protected and only operates at that level. If there is a way to override this do let me know. Also there is an Paint event that could be useful but I'm still working on it.
|
| MigrationUser 1 Friday, May 07, 2004 1:01 AM |
Hi,SnowyOwl: I am also looking for the answer, if you have got pls tell me.
My e-mail address is zhanghua@hnair.com.
Thank you. |
| MigrationUser 1 Tuesday, May 11, 2004 12:00 AM |
A bad solution is to hide the scroll bar with a label. I know its a cheat but I haven't found another solution. |
| MigrationUser 1 Wednesday, July 07, 2004 5:04 PM |
Why don't you just move the controls when the scrollbar changes? |
| MigrationUser 1 Sunday, July 11, 2004 8:47 AM |
Yeah,
If you don't need the autoscroll feature, why do you care for the overhead? I would inherit directly from the control class, and provide a VScrollBar/HScrollBar. |
| MigrationUser 1 Sunday, July 18, 2004 9:48 PM |
Hi, I have some solutions for that kind of problems. please take a look in my blog.
Scrolling 2 panel at the same time in c# 1.This is the ideas for solution. http://www.blogontheweb.com/jason_2004/archive/2004/03/03/4458.aspx 2.This is the sample code for solution. http://www.blogontheweb.com/jason_2004/archive/2004/04/26/7951.aspx
Hiding ScrollBar in panel without giving autoscroll property=false http://www.blogontheweb.com/jason_2004/archive/2004/03/11/4959.aspx
Regards, jason
|
| MigrationUser 1 Wednesday, July 21, 2004 2:37 AM |
You cant set location if the controls within the panel u want to scroll is docked
Has anyone got a simple solution for use with VB.net? |
| MigrationUser 1 Monday, July 26, 2004 7:07 AM |
Hello,
The AutoScroll property does nothing but to change the location of the child controls appropriately in the WM_HSCROLL and WM_VSCROLL messages. So you might do your own scrolling as a response of - lets say button click.
Point pos = this.childControl1.Location;
//perform scroll down by decreasing the top value of the control this.childControl1.Location = new Point(pos.X, pos.Y - 10);
//perform scroll up by increasing the top value of the control this.childControl1.Location = new Point(pos.X, pos.Y + 10);
Thanks, Georgi
|
| MigrationUser 1 Wednesday, July 28, 2004 4:25 AM |