473,769 Members | 4,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

control scroll without window scroll

3 New Member
Hi,
I programmed a windows forms application. it contains several pictureBoxes, each showing the first picture in a folder. When the mouse is over the pictureBox and you turn your mousewheel, it shows the next/prev picture.

This works fine. The picturebox is getting focus when the mouse enters and the picture changes with the wheel.

But the window is scrolling, too.

How can i prevent the window scroll when one of the pictureBoxes has focus?
Sep 4 '09 #1
4 2955
tlhintoq
3,525 Recognized Expert Specialist
You could change the display mode to 'zoom' so the entire image fits in the PictureBox; then there is nothing to scroll.
Sep 4 '09 #2
delorian0815
3 New Member
I use Zoom already. It's not that I want to scroll the image. I use the mousewheel to go to the next/prev image in that folder.

I have a folder with (let's say) 100 subfolders containing pictures. for each subfolder there is a picturebox (400x400 Pixels) showing the first picture in the subfolder. When I move the mouse onto the picture and use the wheel I want it to show the next or the previous picture.
It does that, but it scrolls the the main window up or down, too. And the is what I want to prevent.
Sep 4 '09 #3
tlhintoq
3,525 Recognized Expert Specialist
It does that, but it scrolls the the main window up or down, too. And the is what I want to prevent.
Oh... the main window. I thought it was scrolling the newly placed image in the PictureWindow. My mistake.

Have you tried putting a handler in the main window as an override of the scroll?

You may want to have a bool that changes when you go in and out of the picturebox. When in the picture box the main window handler does not call the base.scroll. When NOT in the picturebox is does call the base.scroll so the window behaves normally.

I haven't tested this personally but think it should work.
Sep 4 '09 #4
delorian0815
3 New Member
Thank you it worked just fine.
I had to put a bool in both the main window and the picturebox, because the picturebox wouldn't lose focus when the mouse leaves.

thanks again.
Sep 4 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
7982
by: Noozer | last post by:
I am able to place values on forms that load into my webbrowser control, but I'd like to be able to scan the page for data. I know to use the HTMLDocument object. Basically I'm hoping to find an example of a DocumentComplete routine that will: - display a list of all elements (tags?) on the page - number of forms on the page - ID, name, type and value for each field on the form
3
1807
by: Nilesh | last post by:
Hi, In my application i need to create the controls at runtime and also need to position them. I am doing it by this like, control.Location = new Point(x,y); Now when i am getting lets say y greater than 32767 (lets say y = 33421) after setting this location property it again becomes 32767. so i am not able to position my controls.
0
3546
by: msnews.microsoft.com | last post by:
Hello, I am trying to remove the scrollbars from any page I load up into the browser control on a window form. I first tried the following: browserDoc = (mshtml.HTMLDocument)browser.Document; browserBody = (mshtml.HTMLBody)browserDoc.body; browserBody.scroll = "no"; This worked for most pages but not all. When I navigated to the following web site:
0
1538
by: Kenneth H. Brannigan | last post by:
Hello, I am trying to remove the scrollbars from any page I load up into the browser control on a window form. I first tried the following: browserDoc = (mshtml.HTMLDocument)browser.Document; browserBody = (mshtml.HTMLBody)browserDoc.body; browserBody.scroll = "no"; This worked for most pages but not all. When I navigated to the following web site:
2
2226
by: usenet | last post by:
When I open a form design window in Access 2003 it *always* has scroll bars, this is even when the form itself is tiny. It's as if the 'page' on which the form is being designed is very large. Is this normal? If so it's very annoying and confusing. If not then how do I get it so my form design window doesn't have scroll bars. -- Chris Green
2
7564
by: Paul E Collins | last post by:
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...
5
3282
by: Dinsdale | last post by:
I have an application that recieves text data via external input (i.e. serial) and displays it on the screen (we use carraige return as a delimiter). At this point I use a regular old text box and when the text size gets too big I truncate the string and re-set the TextBox.Text property. This solution is very crappy as it creates a flickering scroll bar when I re-set the text. Scrolling is also difficult because the position in the text...
3
2518
by: =?Utf-8?B?Qw==?= | last post by:
Hi, I have a user control which I use on all my pages. The control is situated on the top of my page (sits on my master page). For some long pages the user has to scroll back up to the top of the page to select an option from my user control. Can I make this user control floatable so that as the user scrolls down the page the user control moves down also?
4
4053
by: stuckagain | last post by:
Hi, I have a page with a scrollable DIV, and within that DIV, I have a few asp.net menu controls. The idea being, the user mouses over the small icons and is presented with a list of options. One of these lists has more data than the page allows for, so the menu control automatically creates the scroll up / scroll down commands at both ends of the menu. The problem is; since it is within a scrollable div, the menu scroller are hidden! ...
0
9587
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9993
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.