with thisform .caption = m.tcCaption with .PopList .controlsource = m.tcControlSource .listindex = 1 lcFontStyle = iif(.fontbold,"B","") + ; iif(.fontitalic,"I","")+ ; iif(.fontstrikethru,"-","")+ ; iif(.fontunderline,"U","") lnHeight = (fontmetric( 1, .fontname, .fontsize , m.lcFontStyle ) ; + fontmetric( 5, .fontname, .fontsize , m.lcFontStyle )) lnWidth = txtwidth(m.lcText, .fontname, .fontsize , m.lcFontStyle ) * ; fontmetric( 6, .fontname, .fontsize , m.lcFontStyle ) .height = min((m.lnHeight+4.5 )*.listcount, _screen.height - thisform.top - 30) .width = min (m.lnWidth, _screen.width - thisform.left - 30) endwith .height = .PopList.height .width = .PopList.width endwithThanks again.
lnHeight = FONTMETRIC( 1, cFontName, nFontSize , cFontStyle ) ; > + FONTMETRIC( 5, cFontName, nFontSize , cFontStyle )>For the width use
lnWidth = TXTWIDTH( m.MyText, cFontName, nFontSize , cFontStyle ) ; > * FONTMETRIC( 6, cFontName, nFontSize , cFontStyle )>NOTE: Do never forget to specify all font parameters!