I am doing windows forms application in C++, using visual studio 2005.
I could reach Form2 from Form1 by clicking a "log-in" button in Form1, after fill in the name in a textbox.
Then I would like to show the log-in name in Form2 somewhere. I have got a class for the name and other things called the "Profile".
I thought I could make a label first (label2) and try to change the code governing it to show the log-in name.
Codes for label2:
Profile abc;
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(105, 26);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(41, 12);
this->label2->TabIndex = 1;
this->label2->Text = abc.getId(id);
The red parts are my changes.
The last line used to be "this->label2->Text = L"label2";" , showing "label2" in Form2.
But my change is not working and got error. I wonder how to fix it.
The following is my class for "Profile":
using namespace std;
class Profile
{
private:
char id[20];
int win;
int lose;
public:
Profile();
Profile(char *Id, int win, int lose);
~Profile();
void getId(char *Id);
int getWin();
int getLose();
void setId(char *Id);
void setWin (int Win);
void setLose (int Lose);
int read_Record(char *FName, char *Id);
public:
int update_Record(char *FName);
};
Thanks !