DoThix HowTo DoThix_HowTo DoThix HowTo DoThix_HowTo - 1 year ago 101
C# Question

Getting Cannot implicitly convert type 'int' to 'bool' in Visual Studio Community 2015

if (progressBar1.Value = 100)
MessageBox.Show("Time Out!"), ("Timer!");

It Always Show me the Title Error

The error fixed, but message box not showing up lol...

Answer Source

In your if condition you are trying to assign 100 to progressBar1.Value using single =, to compare you need to use double == then progressBar1.Value == 100 statement will produce a Boolean value

if (progressBar1.Value == 100) 
   MessageBox.Show("Time Out!", "Timer!"); // with title

and your MessageBox with title should be like

MessageBox.Show("Time Out!", "Timer!");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download