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 / January 2005

Tip: Looking for answers? Try searching our database.

Scrolling Problems in a Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert Gross - 21 Jan 2005 09:42 GMT
Hi everybody,

I have a little problem, no two. First my english is not quiet good so
please try to understand what I want and help me, please ;) And second:

I habe a Form. In this form is a ScrollableControl (modified, so it could
raise scroll events), containing another Control painting an image. Okay,
everything works fine, but if I deactivate the Form (it's a mdi child form)
and activates another Form and than go back, the scrollbars are reseted to
the default settings, very top and very left! I will get the same behavior,
when I deactivate the hole application an than activate it again. If the
mdi-child Forms are deactivate, there are showing the right scrollbar
positions and the correct clipping of the image. Only when I activate the
form, the form resets the scrollbarpositions :(

Me first solution is, receiving the activate Event raised by the form and
than set the scrollbar positions. This dosn't work! Than I try the receive
all window messages to get the WM_ACTIVATE, WM_MDIACTIVE, WM_NCACTIVATE,
WM_SETFOCUS and the WM_IME_SETCONTEXT messages. If I acted on these messages
I got a really funny behavior of me application. I have deactive (by
clicking to no application on taskbar) and than have activate (by clicking
the taskbar icon), than the scrollbar shows again the wrong position, but
when I moved the mouse of the form, the scrollbar reposition them self and
show the correct positions.

Now I react on every message posted throu the WNDPROC function and set the
scrollbar positions. This works, BUT if I do a large/small de/in-crement
scroll with one mouseclick the scrollbar do the de/increment and immediately
set them back to the previous position. This isn't good :(

Maybe some of you know the correct window message, so I can set me
scrollbars I the form will activate by clicking the nonclient or client
area, or the application and so on.

Have many, many thanks

Robert Gro?
Robert Gross - 21 Jan 2005 11:29 GMT
Hi everybody (again),

I found me fault. The containing scrollableControl was not inherited from
ScrollableControl but from UserControl.

Now it works.

Bye
Robert.

> Hi everybody,
>
[quoted text clipped - 33 lines]
>
> Robert Gro?

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.