OK, i am using Microsoft Visual C++ 2005 Express Edition, and am

using the Window Applications part of it (compared to using Command

Prompt to display programs) Now, as for the program, i am making a

password machine that tells users to enter a username and password,

my program will only check the password and if it is the correct

password( )(a blank space) then it will display a message saying you

have logged in, if not it, it will say invalid password. But there is one

error, when i am debugging my program it keeps on coming up with

this: error C2451: conditional expression of type 'void' is illegal

expressions of type void cannot be converted to other types

Here is the part of the code it applies to...

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
if( textBox2->Text = " " )
label3->Text = "Welcome."; 
label3->Text = "Invalid UserName or PassWord.";

Please help me on this program..

I am COMPLETELY Stumpted:confused:

9 Years
Discussion Span
Last Post by lotsofsloths

Here is the part of the code it applies to...

if( textBox2->Text = " " )

Shouldn't you use a == instead of a single = P.S.
If that doesn't work, then you will have to use a function like strcmp or an equivalent in Managed C++.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.