Click here to Skip to main content
15,867,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to set the status of a toolstrip button from a different thread. I've determined that an invoke is required...but I just don't understand enough C# to figure out what to do.

I have:
C#
if (toolStrip1.InvokeRequired)
{
	// What do I put here?
}
else
{
	tsImportButton.Enabled = true;
	tsImportButton.Checked = false;
}


What I have tried:

I've tried understanding C# and failed...
Posted
Updated 4-Mar-19 19:57pm

 
Share this answer
 
Comments
TheRealSteveJudge 5-Mar-19 1:56am    
5* for good example
In addition to solution 1 I would like to recommend the following:
How to: Make Thread-Safe Calls to Windows Forms Controls | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900