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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnDraw() in a dialog box

Status
Not open for further replies.

minifiredragon

Programmer
Jun 29, 2003
68
US
I tried to implement the OnDraw() function on a dialog box I added to an SDI document. It doesn't update my window. I just get blank spaces where my static boxes are. Is there something I have to implement before I can use OnDraw?? I tried UpdateData(TRUE); as well as UpdateData(FALSE);. Niether of them worked. I do have the OnInitDialog() added.

I am just scratching my head now.
 
If you don't plan on drawing all the dialog controls yourself, you will need to call the dialog's default paint function and then do any specialized drawing after that.

Hope this helps.
 
All I planned on doing was updating some static text, but with some thought I think I don't need OnDraw, so I shall see!!
 
In you InitDialog (or where it makes sense) you can do the following:

GetDlgItem(IDC_CONTROL_CODE)->SetWindowText("Your Text");

where IDC_CONTROL_CODE is the control's id code set in the resource editor.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top