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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:06:16+00:00 2026-05-18T01:06:16+00:00

trying to run a function without putting it in the Main() when the program

  • 0

trying to run a function without putting it in the Main() when the program is run.
how do I start the new created function?
trying to call RunMix() in the Main() but get an error because of the lable1

namespace mixer 
{ 
    public partial class Form1 : Form 
    { 
        public Form1() 
        { 
            InitializeComponent(); 
        } 

        int i = 0; 

        public void RunMix() 
        { 
            while (i == 0) 
            { 
                label1.Text = knob1.Angle.ToString(); 
                Application.DoEvents(); 
            } 
        } 

        private void Form1_Load(object sender, EventArgs e) 
        { 
            RunMix(); 
        } 
    } 
}
  • 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-18T01:06:17+00:00Added an answer on May 18, 2026 at 1:06 am

    Alright my first answer was completely off the topic because of your mysterious question. Now that you have updated it I have better – not complete – understanding of what do you mean.

    Looking at code I guess what you are trying to do is to change the value of label when knob1 control’s angle changes. If knob1 is a control it should have a change event and you should change value of label1 inside knob1_change event handler. If knob1 doesn’t have any event – highly unlikely – then you should use a timer instead. Loop is simply a bad idea in your situation. Timer should work like this

    Timer timer = new Timer();
    public void RunMix(object sender, EventArgs e)
    {
      label1.Text = knob1.Angle.ToString();            
    }
    
    private void Form1_Load(object sender, EventArgs e)
    {
      timer.Interval = 100;
      timer.Tick += new EventHandler(RunMix);
      timer.Start();
    }
    

    Stop timer when form is closed or use activate/deactivate cycle depending upon your requirement.

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

Sidebar

Related Questions

I am trying to run a function or procedure in Delphi asynchronously, but without
I am trying to run a simple multiple processes application in Python. The main
I am trying to create a point system in my program similar to stack
I am trying to run a shell script from within a .vimrc file (three
I'm trying to write a plugin that calls a function (icalendar-import-file) which has the
I am trying to write an ultra simple solution to load a bunch of
I have seen the following methods of putting JavaScript code in an <a> tag:
I have a unmanaged C++ function with the following signature: int function(char* param, int
The following is a erlang function. I don't understand how lists:map function is used
How do you create a unit test case in c for a buffer overflow

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.