
Changing the Font in a text box
Quote:
> > I have created a number of text boxes dynamically but they all seem to
> > be the same font which i would like to change and also in bold. I
> > cant work out how to change this, the code is like
> > CStatic *m_labels[100];
> > m_labels[i] = new CStatic()
> > m_labels[i]->Create("TEXT", WS_VISIBLE, rect, this);
> > I have tried putting m_labels[i]->SetFont(&font) after this but this
> > doesnt seem to do anything.
> > Can anyone help me please?
> Your approach is correct. Make sure the CFont you use is a member
> variable - it has to last as long as the controls.
Thanks Scott, thats excatly what i was doing wrong.
Another quick question though... how do i center the text horizontally
in the box and how to i change the text colour? I'm sure it is quite
simple but i cannot see the options in CFont createfont()?