change font for TXBrowse()

Post Reply
edu_parada
Posts: 33
Joined: Sat Jul 07, 2007 5:53 pm

change font for TXBrowse()

Post 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!!!!
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
edu_parada
Posts: 33
Joined: Sat Jul 07, 2007 5:53 pm

Post by edu_parada »

Thanks, but I want that the user can change the font during the program execution.
edu_parada
Posts: 33
Joined: Sat Jul 07, 2007 5:53 pm

Post by edu_parada »

Please, any advice!!!!!!!!!!. Thank you.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Edu,

We are going to build a sample for you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply