Click here to Skip to main content
15,920,111 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Side-by-side configuration errors Pin
Lucidation31-Mar-10 7:17
Lucidation31-Mar-10 7:17 
GeneralRe: Side-by-side configuration errors Pin
dybs3-Apr-10 18:06
dybs3-Apr-10 18:06 
QuestionExpandable Property in Win Forms Property Grid Pin
zeos626-Mar-10 12:04
zeos626-Mar-10 12:04 
QuestionWhat is this message telling me? Pin
Bert Fegyverneki26-Mar-10 6:00
Bert Fegyverneki26-Mar-10 6:00 
AnswerRe: What is this message telling me? Pin
Ghydo26-Mar-10 7:34
Ghydo26-Mar-10 7:34 
GeneralRe: What is this message telling me? Pin
Bert Fegyverneki26-Mar-10 9:22
Bert Fegyverneki26-Mar-10 9:22 
GeneralRe: What is this message telling me? Pin
Ghydo26-Mar-10 10:25
Ghydo26-Mar-10 10:25 
QuestionDisplay current time in Label control Pin
Lucidation26-Mar-10 5:30
Lucidation26-Mar-10 5:30 
I'm almost brand new to C++ so I'm hoping someone can help me out. I'm using Visual Studio 2008 to create a C++ Windows Form application, and I want to display the current time in place of some static text I was previously using as one of my Label controls. I've spent some time poking around and I think I'm missing something basic.

I was trying something like this:
this->label1->Text = System::DateTime::Now;


and something a little more complexe like this:
this->label1->Text = (System::DateTime::Now.ToString("T"));


But no matter how I manipulate the line, either the code editor or the design editor within Visual Basic Studio barks at me. On my first example shown above, the code editor tells me it "....cannot convert parameter 1 from 'System::DateTime' to 'System::String ^'" while the design editor is just fine. And on my second example shown above, the design editor tells me "C++ CodeDOM parser error:Line:76, Column:56 --- Internal Error" while the code editor is just fine.

So can someone help me out here and let me know what I'm missing? My goal is to just have something like "5:11:45 PM" show up as the text of my Label control when a user runs the program.

Thanks!
AnswerRe: Display current time in Label control Pin
Luc Pattyn26-Mar-10 5:54
sitebuilderLuc Pattyn26-Mar-10 5:54 
GeneralRe: Display current time in Label control Pin
Lucidation26-Mar-10 6:28
Lucidation26-Mar-10 6:28 
GeneralRe: Display current time in Label control Pin
Luc Pattyn26-Mar-10 6:44
sitebuilderLuc Pattyn26-Mar-10 6:44 
GeneralRe: Display current time in Label control Pin
Lucidation26-Mar-10 7:07
Lucidation26-Mar-10 7:07 
GeneralRe: Display current time in Label control Pin
Ghydo26-Mar-10 7:37
Ghydo26-Mar-10 7:37 
GeneralRe: Display current time in Label control Pin
Lucidation26-Mar-10 7:44
Lucidation26-Mar-10 7:44 
QuestionChange text color Pin
jashimu25-Mar-10 4:14
jashimu25-Mar-10 4:14 
AnswerRe: Change text color Pin
Andreoli Carlo25-Mar-10 6:01
professionalAndreoli Carlo25-Mar-10 6:01 
AnswerRe: Change text color Pin
Richard MacCutchan25-Mar-10 6:01
mveRichard MacCutchan25-Mar-10 6:01 
QuestionWindows XP Problems since updating from VS2005 to VS2008 Pin
Joschwenk66623-Mar-10 11:07
Joschwenk66623-Mar-10 11:07 
AnswerRe: Windows XP Problems since updating from VS2005 to VS2008 Pin
T210224-Mar-10 19:18
T210224-Mar-10 19:18 
QuestionProblem : Converting a System::String^ to char[512] Pin
vidasco18-Mar-10 1:07
vidasco18-Mar-10 1:07 
AnswerRe: Problem : Converting a System::String^ to char[512] Pin
Andreoli Carlo18-Mar-10 1:21
professionalAndreoli Carlo18-Mar-10 1:21 
AnswerRe: Problem : Converting a System::String^ to char[512] Pin
Richard MacCutchan18-Mar-10 3:20
mveRichard MacCutchan18-Mar-10 3:20 
Questionextend class and casting Pin
Andreoli Carlo18-Mar-10 0:20
professionalAndreoli Carlo18-Mar-10 0:20 
AnswerRe: extend class and casting Pin
teejayem18-Mar-10 8:15
teejayem18-Mar-10 8:15 
GeneralRe: extend class and casting Pin
Andreoli Carlo18-Mar-10 22:05
professionalAndreoli Carlo18-Mar-10 22:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.