Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Suppress Vertical Scroll when resized form receives focus

Posted on 2013-05-10
2
Medium Priority
?
294 Views
Last Modified: 2013-05-14
Hi,

When my main form is visible on the desktop, and I re-size it to some smaller size, thereby showing the Vertical + Horizontal Scroll bars (Auto Scroll was set to true for the form).  Then using the Vertical Scroll bar that's now visible, if I manually scroll the current form view say half way down to show me a certain region of the form that I want to monitor for incoming data.

And then...

After the form loses focus and then when the form receives focus back, it automatically scrolls the contents of the form to bring whatever control within the form has focus (basically brings that focused control into view).  

I want to suppress this automatic "when form comes into focus and then scrolls the contents so that the focused control is in view..." thing...

How do I do that...
0
Comment
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 39164398
0
 

Author Comment

by:RobertFromSecretWeapons
ID: 39166685
You're bang on here....

Here is the actual solution to the issue:

Protected Overrides Function ScrollToControl(ByVal activeControl As Control) As Point
        Return DisplayRectangle.Location
End Function
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question