|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Forms and labelsI am new to Famework Programming and I need your help. In Visual C++ .NET Forms. Labels. If I want to add XXXX to the label, I can do that through the "Text" property in the property editor. But I want to add the XXXX during run time. In other words I want the label to be written during run time. void InitializeComponent(void) { // // label2 // this->label2->Location = System::Drawing::Point(32,16); this->label2->Name = S"label2"; this->label2->Size = System::Drawing::Size(208, 23); this->label2->TabIndex = 6; this->label2->Text = S"XXXX"; } Then add
this->label2->Text = S"XXXX"; to your form's load event handler. -- Show quoteHide quoteBryan Phillips MCSD, MCDBA, MCSE Blog: http://bphillips76.spaces.live.com Web Site: http://www.composablesystems.net "Allen Maki" <allenm***@sbcglobal.net> wrote in message news:hGWUh.17172$Um6.16890@newssvr12.news.prodigy.net: > Hi Everybody, > > > > I am new to Famework Programming and I need your help. > > > > In Visual C++ .NET > > Forms. > > Labels. > > > > If I want to add XXXX to the label, I can do that through the "Text" > property in the property editor. But I want to add the XXXX during run > time. In other words I want the label to be written during run time. > > > > void InitializeComponent(void) > > { > > // > > // label2 > > // > > this->label2->Location = System::Drawing::Point(32,16); > > this->label2->Name = S"label2"; > > this->label2->Size = System::Drawing::Size(208, 23); > > this->label2->TabIndex = 6; > > this->label2->Text = S"XXXX"; > > } Hi Bryant,
Thank you for your help. You want me to do it like this: private: System::Void label2_Click(System::Object * sender, System::EventArgs * e) { this->label2->Text = S"XXXX"; } I appreciate any details you may give. Show quoteHide quote "Bryan Phillips" <bphillips@nospam.spamcop.net.spammenot> wrote in message news:uwViMaKgHHA.4980@TK2MSFTNGP02.phx.gbl... > Then add > > this->label2->Text = S"XXXX"; > > to your form's load event handler. > > -- > Bryan Phillips > MCSD, MCDBA, MCSE > Blog: http://bphillips76.spaces.live.com > Web Site: http://www.composablesystems.net > > > > "Allen Maki" <allenm***@sbcglobal.net> wrote in message > news:hGWUh.17172$Um6.16890@newssvr12.news.prodigy.net: > >> Hi Everybody, >> >> >> >> I am new to Famework Programming and I need your help. >> >> >> >> In Visual C++ .NET >> >> Forms. >> >> Labels. >> >> >> >> If I want to add XXXX to the label, I can do that through the "Text" >> property in the property editor. But I want to add the XXXX during run >> time. In other words I want the label to be written during run time. >> >> >> >> void InitializeComponent(void) >> >> { >> >> // >> >> // label2 >> >> // >> >> this->label2->Location = System::Drawing::Point(32,16); >> >> this->label2->Name = S"label2"; >> >> this->label2->Size = System::Drawing::Size(208, 23); >> >> this->label2->TabIndex = 6; >> >> this->label2->Text = S"XXXX"; >> >> } > If that is where you need the text property to be set, then yes.
-- Show quoteHide quoteBryan Phillips MCSD, MCDBA, MCSE Blog: http://bphillips76.spaces.live.com Web Site: http://www.composablesystems.net "Allen Maki" <allenm***@sbcglobal.net> wrote in message news:Tt9Vh.6924$5e2.3929@newssvr11.news.prodigy.net: > Hi Bryant, > > Thank you for your help. > > You want me to do it like this: > > private: System::Void label2_Click(System::Object * sender, > System::EventArgs * e) > > { > > this->label2->Text = S"XXXX"; > > } > > I appreciate any details you may give. > > > > > "Bryan Phillips" <bphillips@nospam.spamcop.net.spammenot> wrote in message > news:uwViMaKgHHA.4980@TK2MSFTNGP02.phx.gbl... > > Then add > > > > this->label2->Text = S"XXXX"; > > > > to your form's load event handler. > > > > -- > > Bryan Phillips > > MCSD, MCDBA, MCSE > > Blog: http://bphillips76.spaces.live.com > > Web Site: http://www.composablesystems.net > > > > > > > > "Allen Maki" <allenm***@sbcglobal.net> wrote in message > > news:hGWUh.17172$Um6.16890@newssvr12.news.prodigy.net: > > > >> Hi Everybody, > >> > >> > >> > >> I am new to Famework Programming and I need your help. > >> > >> > >> > >> In Visual C++ .NET > >> > >> Forms. > >> > >> Labels. > >> > >> > >> > >> If I want to add XXXX to the label, I can do that through the "Text" > >> property in the property editor. But I want to add the XXXX during run > >> time. In other words I want the label to be written during run time. > >> > >> > >> > >> void InitializeComponent(void) > >> > >> { > >> > >> // > >> > >> // label2 > >> > >> // > >> > >> this->label2->Location = System::Drawing::Point(32,16); > >> > >> this->label2->Name = S"label2"; > >> > >> this->label2->Size = System::Drawing::Size(208, 23); > >> > >> this->label2->TabIndex = 6; > >> > >> this->label2->Text = S"XXXX"; > >> > >> } > >
Other interesting topics
Databind a nullable date to a masked textbox
Graphics dpi not correct This code compiles/runs but breaks designer... Adding an event handler to a dynamically populated control Datagridview help Problems with BackGroundWorker Is it possible to set a TextRenderingHint for an entire appplication? Newbie question: how to set focus to a usercontrol Login window vs Main window How to read Default Values from App.Config for User Settings? |
|||||||||||||||||||||||