Jump to content

I have a problem with my C# Windows Form Application.

When i click on a checkbox to turn its state to true it calls a Public void in another class (Class2.callFunction)

 

This Class2.callFunction has code that gets enabled but it freezes my whole application.

When i test what the code does outside of the application it works but i want to be able to use the Form still without it been frozen.

 

CheckBox:

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {
                Class2 class2 = new Class2();
                class2.callFunction();
            }
        }

Function Called:

 public void callFunction()
        {
            CODE HERE I CAN NOT SHOW!
        }

 

The code works but in the call function which is in a class of its own freezes the application when its put into use.

Link to comment
https://linustechtips.com/topic/690229-i-need-help-with-a-problem-c/
Share on other sites

Link to post
Share on other sites

6 minutes ago, SD2020_ said:

Hey there so I have a problem with my C# application and unfortunately there is no one I can talk with as I do not have friends that are inserted in programming what so ever.

 

The problem I am having I can not discuss it over the forums but I need to discuss it over TeamSpeak or Skype or Discord.

Just needs to be explained voice to voice so it can be solved faster :)

 

Please message me or comment below with one of the three voice communication services we can use :)

 

Thanks in advance!

Check the unofficial official LTT discord for help we have many people who can help you.

 https://discord.gg/3TKvh

Hello

Link to post
Share on other sites

16 minutes ago, TAHIRMIA said:

Check the unofficial official LTT discord for help we have many people who can help you.

 https://discord.gg/3TKvh

or just post your problem here and someone will have a look.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to post
Share on other sites

8 minutes ago, TAHIRMIA said:

He probably needs someone to walk him through it like a video tutorial or something 

Exactly I could search google all day but i need to be told voice to voice what to do its a learning disability it sucks..

Link to post
Share on other sites

4 minutes ago, SD2020_ said:

Exactly I could search google all day but i need to be told voice to voice what to do its a learning disability it sucks..

If you tell people your problem on the server they will assist you better 

Hello

Link to post
Share on other sites

Without knowing what the code is doing I can only guess, but it sounds to me like the function is running for a while and that's and keeping the UI thread busy so you can't do other things. This could be because of an infinite loop, or something else that's just taking a long time to execute.

 

If it's not supposed to run for a long time, then it could be due to a bug. Fixing that could stop the infinite loop/long running task and make everything work properly. Otherwise, you probably need to run the function asynchronously or in another thread.

 

If you can't post the code publicly, perhaps you can send it to me in a private message so I can take a look.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×