jellylogix
April 9th, 2008, 07:48 PM
i'm making a windows form application in VS 2008 and i'm really new at it. I got the time to display using
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
DateTime dt=System::DateTime::Now;
this->label1->Text::set(dt.ToString());
}
but when i try using this code:
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
DateTime dw=System::DateTime::DayOfWeek;
this->label1->Text::set(dw.ToString());
}
then i receive errors that say:
error C2597: illegal reference to non-static member 'System::DateTime::DayOfWeek'
error C2440: 'initializing' : cannot convert from '' to 'System::DateTime'
I'm really new at Windows forms, and have learned everything through trial and error, but here i'm stumped! i have no idea what a "non-static member" is and why this code won't work... if maybe you could just tell me a code that would return the value of the day of the week (something like "Thursday" so that i can use it in a label. that would be great!
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
DateTime dt=System::DateTime::Now;
this->label1->Text::set(dt.ToString());
}
but when i try using this code:
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
DateTime dw=System::DateTime::DayOfWeek;
this->label1->Text::set(dw.ToString());
}
then i receive errors that say:
error C2597: illegal reference to non-static member 'System::DateTime::DayOfWeek'
error C2440: 'initializing' : cannot convert from '' to 'System::DateTime'
I'm really new at Windows forms, and have learned everything through trial and error, but here i'm stumped! i have no idea what a "non-static member" is and why this code won't work... if maybe you could just tell me a code that would return the value of the day of the week (something like "Thursday" so that i can use it in a label. that would be great!