Larghezza testo in BUTTON/BTNBMP

Moderator: Enrico Maria Giordano

Larghezza testo in BUTTON/BTNBMP

Postby Romeo » Thu Feb 06, 2014 3:26 pm

Salve,

ho avuto la poco brillante idea di fare scegliere all'utente il font da usare per i BUTTON o BTNBMP...

Ora succede che se scelgono un font troppo grande, sbrodola tutto e fa casino.

Domanda: Non e' possibile sapere quanto e' largo un testo che scrivo in un BUTTON o BTNBMP ?

Mi sto perdendo.....

Ho provato ad utilizzare questo esempio:

@10,10 BUTTON obtn prompt cvar of ownd size a,b font ofont pixel

xbutt:=obtn:nWidth
ybutt:=obtn:nHeight

xtesto:=GetTextWidth(0,cvar,ofont)
ytesto:=GetTextHeight(0,cvar,ofont)

E poi proseguo con i test x capire se ci stà il cvar nel button, ma canno da qualche parte !??!?

Grazie

Romeo/Zingoni
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Larghezza testo in BUTTON/BTNBMP

Postby Enrico Maria Giordano » Thu Feb 06, 2014 6:53 pm

Romeo,

Romeo wrote:xtesto:=GetTextWidth(0,cvar,ofont)
ytesto:=GetTextHeight(0,cvar,ofont)


Code: Select all  Expand view
xtesto:=GetTextWidth(0,cvar,ofont:hFont)


Mentre non mi risulta una GetTextHeight() analoga alla GetTextWidth().

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8299
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to All products support

Who is online

Users browsing this forum: No registered users and 1 guest