Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2006

Tip: Looking for answers? Try searching our database.

Autoscroll panel bug?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Igor - 17 Feb 2006 14:00 GMT
Hi all!

Here is the thing:
I have a panel with autoscroll set to true, and have controls that are outside the viewing area (thus the autoscroll:).
Now, I know that the autoscroll panel scrolls the focused control into view which is ok, but it also happens on paint event - when anything changes on the form, the control is focused into view.

In my example, I have two buttons on the panel. button1 is visible and button2 is on the bottom - you have to scroll to it.
To demonstrate this, try to scroll to button2 using the scrollbar on the panel WHILE the label is counting.
You can't, right?
Now, click button1 to stop the counter.
Now you can, right?

You have to keep the focus on button1 for the test to work.

What's up with that?
Is there a workaround?

PLEASE HELP!!!
Stoitcho Goutsev (100) - 17 Feb 2006 16:25 GMT
Igor,

The problem is that If the AutoSize property is not set to True the label
revert its size to the original value. The because it is docked the whole
layout engine kick in and this moves the scrollers. Why? I don't know it
might be a bug...

I have two solutions for you:
1. Set label's AutoSize property to True
2. If for some reason you can't do (1) put the label on a panel, docke the
label Fill and dock the panel Top. This will take care of the problem
because the label will cause its container (the second panel) to re-layout
and this won't affect the panel with the scorll bars.

Signature

HTH
Stoitcho Goutsev (100)

> Hi all!
>
[quoted text clipped - 19 lines]
>
> PLEASE HELP!!!

--------------------------------------------------------------------------------

> Module Module1
>    Dim l As New System.Windows.Forms.Label
[quoted text clipped - 36 lines]
>    End Sub
> End Module
Igor - 17 Feb 2006 18:50 GMT
> Igor,
>
[quoted text clipped - 9 lines]
> because the label will cause its container (the second panel) to re-layout
> and this won't affect the panel with the scorll bars.

Thanks, but the label in the example is not the problem - I thought it
might be the layout issue. The real problem that I have is in a complex
form - a scrollable panel is inside another panel (also docked) and I'm
blinking the icon on the statusstriplabel (2005) on a statustrip. If I
put the statutstrip inside a panel and do as you suggested I'll be in a
world of hurt. especially because it is implemented in a superclass form
from which I derive all my forms...

I've created my own "scrollablepanel" which doesn't have this "feature",
but I'd like to minimize custom controls usage as they slow down already
quite poor performace of the UI.

But, thanx for the suggestion :)
Drop some other ideas if you've got'em :)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.