Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Display INT Variables in a Dialog?

Status
Not open for further replies.

wui75

Technical User
Dec 25, 2000
2
0
0
SG
Hi there,

May I know what should I do to display int variables in the dialog itself?

I want the variables to be displayed directly in my dialog, and not to display any pop-out messageboxes like
MessageBox() or AfxMessageBox().

Thanks alot!
 
What exactly do you mean by "on the dialog itself". My guess would be that u have an edit control whose properties are set in such a way that it appears flat and does not look like a seperate control. With this set, you can at run time set the data into this text box by assigning the value to its member variable and then calling UpdateData ().

Hope this helps
Sriks
 
hi there, again the method by sriks is very much fine... but i think that you want to dusplay the int variable 'in the dialog itself, as text'... that means you want a "Static Text" (also called Labels) in the dialog box... to do this you add a CStatic control to the dialog box, and also add a CStatic member variable(by control) to the dialog class . And then when you want to display text, you can call m_cstatic.SetWindowText()...(m_cstatic is a control variable). and in case you have added the variable cstatic to be associated with the control's Value, then you have to call UpdateData(TRUE), after setting the valuue of the variable...

alternately, you can hide the text by displaying a blank string or by using the ShowWindow(SW_HIDE) if it is a control variable...

hope this helped...
sgopinath.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top