Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8607245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:18:11+00:00 2026-06-12T03:18:11+00:00

I am enhancing a Windows Forms application which displays TIFF images. The application has

  • 0

I am enhancing a Windows Forms application which displays TIFF images. The application has a Picturebox on top of a Panel and displays 1 image page at a time (there are thumbnails which users can click on to view a particular image). If there are multiple images the user wants to see the next one by using an event such as the mouse wheel. We currently have previous and next arrow button / function but they want more)

What I believe I should do is find out if the image is at the bottom during a mouse wheel event and then select the next one. Also, same thing the opposite way, get the previous image and scroll to the bottom if they use the mouse wheel going up.

Also, I need to note that the image may be larger than the Panel so a vertical Scroll bar appears. So, when using the mouse wheel, need to make sure it is at the bottom.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:18:13+00:00Added an answer on June 12, 2026 at 3:18 am

    I found a resolution to this

    1) created a new variable to store the previous Vertical Scroll Value (prevVScrollVal).
    2) Create a new MouseEventHandler

    this.imageContainer.MouseWheel += new MouseEventHandler(this.imageContainer_MouseWheel);
    

    3) in Mouse Event Handler identify if up or down by looking @ the e.delta then check if the previous scroll value is the same and switch images accordingly.

        private void imageContainer_MouseWheel(object sender, MouseEventArgs e)
        {
            if (e.Delta > 0)
            {
                imageContainer_MouseWheelScrollUp(sender, e);
            }
            else if (e.Delta < 0)
            {
                imageContainer_MouseWheelScrollDown(sender, e);
            }
    
            prevVScrollVal = imageContainer.VerticalScroll.Value;
        }
    
        private void imageContainer_MouseWheelScrollUp(object sender, MouseEventArgs e)
        {
            if (imageContainer.VerticalScroll.Value == 0 && 
                prevVScrollVal == 0 && 
                current > 1)
            {
                setPagePrev();
            }
        }
    
        private void imageContainer_MouseWheelScrollDown(object sender, MouseEventArgs e)
        {
    
            if (imageContainer.VerticalScroll.Value == prevVScrollVal && 
                    current < endPage)
            {
                setPageNext();
            }
        }
    
        /// <summary>
        /// Sets the page to the Next
        /// </summary>
        private void setPageNext()
        {
            setPage(current + 1);
        }
    
        /// <summary>
        /// Sets the page to the Previous
        /// </summary>
        private void setPagePrev()
        {
            setPage(current - 1);
            prevVScrollVal = imageContainer.VerticalScroll.Maximum;
            imageContainer.VerticalScroll.Value = imageContainer.VerticalScroll.Maximum;
            imageContainer.PerformLayout();
        }
        /// <summary>
        /// Sets the page to be viewed
        /// </summary>
        /// <param name="page">page to be viewed</param>
        public void setPage(int page)
        {  ....  }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to progressively enhancing HTML5 forms, and I'm currently trying jQuery UI and
am running the asp.net application...am enhancing the already developed project..i want to create the
I'm a Flex rookie tasked with enhancing an existing application. One of those enhancements
I have a Spring 3.0 web application which tries to follow the REST principles
Please help me to install capybara gem in Windows. >gem install capybara Temporarily enhancing
I am enhancing an existing web application and I have created a new database
Currently I'm working on enhancing a project that has been developed by an external
I have mixed web application web forms & mvc2. At the moment i have
I'm enhancing our video search page to highlight the search term(s) in the results.
We are currently researching ways of enhancing image quality prior to submission to OCR.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.