Page 1 of 1

change font for TXBrowse()

Posted: Sun Sep 02, 2007 11:27 am
by edu_parada
Hi,

I am trying to change font in XBrowse, allowing the user to change it in runtime. In listbox I did:

oBrowse:Selfont()
oBrowse:Refresh()

But It does not work. Also I have tried:

LOCAL oFont

DEFINE FONT oFont FROM USER

oBrowse:Setfont(oFont)
oBrowse:Refresh()

and it does not work too. How can i do it?. Thank you!!!!

Posted: Mon Sep 03, 2007 5:18 pm
by Antonio Linares
Local oFont

DEFINE FONT oFont NAME "Arial" SIZE 0, -8 BOLD

...

oCol := oBrw:AddCol()
oCol:bStrData := { || _FIELD->First}
oCol:cHeader := "First"
oCol:oDataFont := oFont

Posted: Mon Sep 03, 2007 5:35 pm
by edu_parada
Thanks, but I want that the user can change the font during the program execution.

Posted: Wed Sep 05, 2007 11:57 am
by edu_parada
Please, any advice!!!!!!!!!!. Thank you.

Posted: Wed Sep 05, 2007 3:48 pm
by Antonio Linares
Edu,

We are going to build a sample for you

Posted: Thu Sep 06, 2007 9:29 am
by Antonio Linares
Edu,

Please add this new method to Class TXBrowse:

Code: Select all

METHOD SelFont() CLASS TXBrowse

   local oFont, n

   DEFINE FONT oFont FROM USER
   
   for n = 1 to Len( ::aCols )
      ::aCols[ n ]:oDataFont = oFont
   next
   
   ::Refresh()
   
return nil      
Then simply do:
oXBrowse:SelFont()