HOWTO calcualte real text length in a CStatic
Hi,
how can I calcualate/retrieve the length a CStatic really needs to show a given text.
- or -
How ca I realize a function to change a CStatic to the "optimal" length?
Thank for your help!
K.
[220 byte] By [
kseybold] at [2007-11-18 2:14:14]

# 1 Re: HOWTO calcualte real text length in a CStatic
Hi,
Suppose If your static text is IDC_STATIC
Do like this.
CString st;
GetDlgItemText(IDC_STATIC,st);
then,
st.GetLength(); will return the length of string.
All the Best,
vikram.