Click here to Skip to main content
16,009,640 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linking to a spot in source code Pin
keegan29-Jul-03 5:49
keegan29-Jul-03 5:49 
GeneralRe: Linking to a spot in source code Pin
Neville Franks29-Jul-03 5:56
Neville Franks29-Jul-03 5:56 
GeneralCStringArray in a CList Pin
Anonymous29-Jul-03 4:13
Anonymous29-Jul-03 4:13 
GeneralRe: CStringArray in a CList Pin
Ian Darling29-Jul-03 4:19
Ian Darling29-Jul-03 4:19 
GeneralRe: CStringArray in a CList Pin
Chris Losinger29-Jul-03 5:34
professionalChris Losinger29-Jul-03 5:34 
GeneralRe: CStringArray in a CList Pin
Anna-Jayne Metcalfe29-Jul-03 6:13
Anna-Jayne Metcalfe29-Jul-03 6:13 
QuestionHow to create a text field within a dialog box Pin
Deepak Samuel29-Jul-03 4:12
Deepak Samuel29-Jul-03 4:12 
AnswerRe: How to create a text field within a dialog box Pin
PremL29-Jul-03 5:20
PremL29-Jul-03 5:20 
I assume you already have a dialog working.

Got to the resource editor and add a static text control. Its ID is going to be IDC_STATIC change that to your own ID. Like IDC_MYTEXT. What you put as the text of the static control is going to be the text that is initially displayed.

Now, in one of your dialog message handler, wherever you want to change the text on the dialog, put the following:

CStatic* pText = (CStatic*) GetDlgItem(IDC_MYTEXT); //get a pointer to the control
pText->SetWindowText(“Hello World”); //set the text

When the message handler is called the text is going to change to Hello World.

This works with an edit box too. Make an Edit box on your resource template with ID IDC_MYEDIT. The following code will display the text.

CEdit* pEdit = (CEdit*) this->GetDlgItem(IDC_MYEDIT);
pEdit->SetWindowText("Hello World");

I hope this helps.


Lorenz Prem
Microsoft Corporation
GeneralRe: How to create a text field within a dialog box Pin
armentage29-Jul-03 7:43
armentage29-Jul-03 7:43 
GeneralRe: How to create a text field within a dialog box Pin
Mike Dimmick29-Jul-03 13:32
Mike Dimmick29-Jul-03 13:32 
GeneralRe: How to create a text field within a dialog box Pin
PremL29-Jul-03 13:53
PremL29-Jul-03 13:53 
GeneralRe: How to create a text field within a dialog box Pin
igor196014-Oct-03 11:42
igor196014-Oct-03 11:42 
GeneralHaw to create thread from thread Pin
Member 49993429-Jul-03 3:59
Member 49993429-Jul-03 3:59 
GeneralRe: Haw to create thread from thread Pin
valikac29-Jul-03 5:29
valikac29-Jul-03 5:29 
GeneralDebug exe Pin
novachen29-Jul-03 3:56
novachen29-Jul-03 3:56 
GeneralRe: Debug exe Pin
David Crow29-Jul-03 7:30
David Crow29-Jul-03 7:30 
GeneralRe: Debug exe Pin
Alexander M.,29-Jul-03 9:20
Alexander M.,29-Jul-03 9:20 
GeneralAFX_SQL_ERROR_CONNECT_FAIL Pin
modular29-Jul-03 3:53
modular29-Jul-03 3:53 
GeneralStrange Codes Pin
FlyingDancer29-Jul-03 3:50
FlyingDancer29-Jul-03 3:50 
GeneralRe: Strange Codes Pin
73Zeppelin29-Jul-03 5:45
73Zeppelin29-Jul-03 5:45 
GeneralRe: Strange Codes Pin
David Crow29-Jul-03 7:37
David Crow29-Jul-03 7:37 
GeneralRe: Strange Codes Pin
armentage29-Jul-03 8:24
armentage29-Jul-03 8:24 
GeneralRe: Strange Codes Pin
David Crow29-Jul-03 8:32
David Crow29-Jul-03 8:32 
GeneralRe: Strange Codes Pin
FlyingDancer29-Jul-03 14:39
FlyingDancer29-Jul-03 14:39 
GeneralRe: Strange Codes Pin
David Crow29-Jul-03 16:49
David Crow29-Jul-03 16:49 

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.