Bae Chu
asked on
Windows Forms C++ - Accessing Form Label Value From .cpp File
I'm making windows form called form2.h that has a trackbar and a label on it. I've pass the trackbar value to the label
System::Void trackBar1_Scroll(System::O bject^ sender, System::EventArgs^ e) {
label2->Text = String::Concat( "", trackBar1->Value );
}
I also have a cpp file called form2.cpp and I want to use label2 from form2.h in my cpp file.
for example
string hmin = label2;
cout << hmin;
How do I do that? I already include things like
#include "StdAfx.h"
#include "Form2.h"
#include "stdio.h"
using namespace messagebox;
on top of the cpp file but I still cant use label2 element
System::Void trackBar1_Scroll(System::O
label2->Text = String::Concat( "", trackBar1->Value );
}
I also have a cpp file called form2.cpp and I want to use label2 from form2.h in my cpp file.
for example
string hmin = label2;
cout << hmin;
How do I do that? I already include things like
#include "StdAfx.h"
#include "Form2.h"
#include "stdio.h"
using namespace messagebox;
on top of the cpp file but I still cant use label2 element
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sara