3xodus
Freshman
Hi everyone,
I'm new to C++ (2 days ), and I'm trying to make a function to show a custom MessageBox - I always used to do this in VB6 and VB.NET as imo it looks nicer in certain apps...
Anyway, what I'm trying to do is create a function which can be called, and will show a messagebox with the message of your choice (once it's working I'll add icons and such too).
What I have so far is:
Which could be called like this for example: MyMessage("Hello World!");
My question is about the line that I've commented out. With that line I get the message:
"Cannot access private member declared in class 'prjMsgTest::MsgBox'"
Is it possible to access properties of controls on other forms, as I've failed to do in the code above? If so can anyone give an example? In VB.NET it would simply be
formName.labelName.Text = Notice
TIA for any suggestions
I'm new to C++ (2 days ), and I'm trying to make a function to show a custom MessageBox - I always used to do this in VB6 and VB.NET as imo it looks nicer in certain apps...
Anyway, what I'm trying to do is create a function which can be called, and will show a messagebox with the message of your choice (once it's working I'll add icons and such too).
What I have so far is:
Code:
private: System::Void MyMessage(System::String * Notice)
{
MsgBox *Message= new MsgBox;
//Message->lblNotice->Text = Notice;
Message->ShowDialog();
}
My question is about the line that I've commented out. With that line I get the message:
"Cannot access private member declared in class 'prjMsgTest::MsgBox'"
Is it possible to access properties of controls on other forms, as I've failed to do in the code above? If so can anyone give an example? In VB.NET it would simply be
formName.labelName.Text = Notice
TIA for any suggestions