Hi again, I've run into a problem with an if statement in my code.
Here is the code:

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) 
	{
		if ((textBox1->Text == ("")) && (radioButton1->Checked == false) && (radioButton2->Checked == false) && (radioButton3->Checked = false))
		{
		 Form3 ^form3 = gcnew Form3();
		 form3->Show();
		}
		else
		 {
		Form2 ^form2 = gcnew Form2();
		form2->Show();
		this->Hide();	
		 }
	 }

The errors: (All errors apply for line 3)
error C2180: controlling expression has type 'void'
error C2297: '&&' : illegal, right operand has type 'void'

This is coming from a first time startup screen form. I want all the blanks to be filled out, if they arn't, then I want an error message to display.
If this matters at all, I am using Visual C++ in Visual Studio 2010.

On a side note, does anyone know a better way than

This->Hide(0;

for closing a form window when opening another?

Thanks for any help I get,
TSims11

Edited 5 Years Ago by TSims11: n/a

Try removing the () in

if ((textBox1->Text == ("")) &&

so that its is

if ((textBox1->Text == "") &&

Actually on further inspection, you have on line 3

(radioButton3->Checked = false)

it should be

(radioButton3->Checked == false)

Edited 5 Years Ago by gerard4143: n/a

gerard4143, You are my hero. The second option worked. The first didnt do anything. You saved a beginner a few hairs from being ripped out. Thank you so much.
TSims11

Hey one last question, do you know a better way to close a form than

This->Hide();

??

This article has been dead for over six months. Start a new discussion instead.