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 6845089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:27:27+00:00 2026-05-27T00:27:27+00:00

This is the code in the NumericUpDown ValueChanged event: private void numericUpDown1_ValueChanged(object sender, EventArgs

  • 0

This is the code in the NumericUpDown ValueChanged event:

private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
    DoThresholdCheck();
}

And this is the DoThresholdCheck() code:

private void DoThresholdCheck()
{

    List<int> f;
    List<string> fts;
    const string D6 = "000{0}.bmp";
    if (Directory.Exists(subDirectoryName))
    {



        if (!File.Exists(subDirectoryName + "\\" + averagesListTextFile + ".txt"))
        {
            return;
        }
        else
        {




                f = new List<int>();
                fts = new List<string>();
                Bitmap myFiles;
                int counter = 0;
                double thershold = (double)numericUpDown1.Value;
                double max_min_threshold = (thershold / 100) * (max - min) + min;
                _fi = new DirectoryInfo(subDirectoryName).GetFiles("*.bmp");


                for (int i = 0; i < myNumbers.Count; i++)
                {
                    if (myNumbers[i] >= max_min_threshold)
                    {
                        string t = i.ToString("D6") + ".bmp";
                        if (File.Exists(subDirectoryName + "\\" + t))
                        {
                            button1.Enabled = false;
                            myTrackPanelss1.trackBar1.Enabled = true;



                        }
                        else
                        {
                            button1.Enabled = true;
                            myTrackPanelss1.trackBar1.Enabled = false;
                            pictureBox1.Image = Properties.Resources.Weather_Michmoret;
                            label5.Visible = true;
                            break;
                        }
                    }
                }
                if (myTrackPanelss1.trackBar1.Maximum > 0)
                {
                    SetPicture(0);
                    myTrackPanelss1.trackBar1.Scroll += new EventHandler(trackBar1_Scroll);
                }
                if (_fi.Length >= 0)
                {
                    label15.Text = _fi.Length.ToString();
                    label15.Visible = true;
                }




        }
    }
    else
    {
        button1.Enabled = true;
    }
}

What I want to do is; each time I change the NumericUpDown value in the program it will call the function in the event. In the event I create a new temp list each time and perform operations and make some checks on that list.

The problem is when I’m changing the NumericUpDown value a few times up and down in the program and then try to use the trackBar1 to move between the images again, the trackbar1 moves very slowly. When initially running the program, the slide bar in the trackbar1 moves quickly and moves quickly between images, but when I change the NumericUpDown values the trackbar moves slowly for some reason.

I tried to add a Timer2 and maybe use it in the NumericUpDown to make it call the function only after 500ms, for example, but it didn’t solve it.

I can’t figure out why its moving so slow.

  • 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-05-27T00:27:28+00:00Added an answer on May 27, 2026 at 12:27 am

    I’am not shore if it is the problem, but seems you adding event handler myTrackPanelss1.trackBar1.Scroll += new EventHandler(trackBar1_Scroll); but never removing it. So you always adding event handler and after a wile trackBar1_Scroll will be fired many times. Set breakpoint in trackBar1_Scroll and you will see how many times event handler is raised. Solution could be remove event handler or add it just one time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code does not compile. public class Diamond { public static void diamondOfAsterisks(String *
This code works (C# 3) double d; if(d == (double)(int)d) ...; Is there a
This code produces a FileNotFoundException, but ultimately runs without issue: void ReadXml() { XmlSerializer
This code leads to undefined behavior: void some_func() { goto undefined; { T x
This code: <% string path = Request.ApplicationPath.ToString(); %> <link href=<%= path %>/Content/Site.css rel=stylesheet type=text/css
This code fails when I try to debug it using VC2010: char frd[32]=word-list.txt; FILE
This code: #include Backpack.h #include <sstream> #include <algorithm> int Backpack::getCurrentWeight() { int weight =
this code is supposed to list recent calls with recent same nos skipped but
This Code returns an error on the delete [] placard_; call void Protestor::destroy() {
This code in JS gives me a popup saying i think null is a

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.