Antonio, Enrico, Please look for hOldFont in Class TBtnBmp where it is assigned and change it this way: hOldFont = SelectObject( ::hDC, ::oFont:hFont ) That solves it :-) I found two occurrences: hOldFont = SelectObject( ::hDC, If( ...
... Also, it is a very good practice to save and restore the GDI objects that we select, i.e.: hOldFOnt := SelectObject( oDlgMain:hDC, oMainFont:hFont ) ... SelectObject( oDlgMain:hDC, hOldFont )
... so important, one button, or every buttons. If font will be change on all buttons, it will be OK! I tried to replace this string in btnbmp.prg: hOldFont = SelectObject( ::hDC, If( ::lBarBtn, ::oWnd:oFont:hFont, ::oFont:hFont ) ) // method paint() befor Drawtext... on just simple: hOldFont = ...
... my mistake? - Can I change the font of the buttons captions (prompts) on buttonbar? It seems that string in method paint() of class btnbmp: "hOldFont = SelectObject( ::hDC, If( ::lBarBtn, ::oWnd:oFont:hFont, ::oFont:hFont ) )" means that font always take from parent window... Why it ...
... Static Function DrawRotated(hDC,cPrompt,Y,X,nClrText,nClrPane,oFont) Local hOldFont, nOldMode, nOldClrText, nOldClrPane nOldClrText:=SetTextColor(hDC,nClrText) if nClrPane<>nil nOldClrPane:=SetBkColor(hDC,nClrPane) else ...