oform=CREATEOBJECT('changefont') oform.show() DEFINE CLASS changefont AS form Top = 0 Left = 0 Height = 199 Width = 425 DoCreate = .T. Caption = "Change Textbox FontName Example" Name = "Form1" WindowType=1 DIMENSION gafontarray[1,1] ADD OBJECT combo1 AS combobox WITH ; RowSourceType = 2, ; RowSource = "cafonts.cfont", ; ControlSource = "m.cn_preprta", ; Height = 24, ; Left = 48, ; Style = 2, ; Top = 24, ; Width = 228, ; Name = "Combo1" ADD OBJECT text1 AS textbox WITH ; Value = "This is an example of the font.", ; Height = 23, ; Left = 48, ; ReadOnly = .T., ; TabStop = .F., ; Top = 58, ; Width = 336, ; Name = "Text1" ADD OBJECT combo2 AS combobox WITH ; RowSourceType = 2, ; RowSource = "casize.csize", ; ControlSource = "m.cn_preprtb", ; Height = 24, ; Left = 288, ; Style = 2, ; Top = 24, ; Width = 60, ; Name = "Combo2" PROCEDURE load SET SAFETY OFF CREATE TABLE cafonts (cfont c(30)) IF !USED('cafonts') USE cafonts IN 0 ENDIF CREATE TABLE casize (csize c(2)) IF !USED('casize') USE casize IN 0 ENDIF ENDPROC PROCEDURE Init *--init =AFONT(thisform.gaFontArray) SELE cafonts FOR i = 1 TO ALEN(thisform.gaFontArray,1) APPEND BLANK REPLACE cafonts.cfont WITH gaFontArray(i) ENDFOR GO TOP SELE casize FOR i = 6 TO 12 STEP 2 APPEND BLANK REPLACE casize.csize WITH ALLTRIM(STR(i)) ENDFOR GO TOP LOCATE FOR casize.csize="12" IF EOF() GO TOP ENDIF m.cn_preprtb=casize.csize SELE cafonts INDEX ON cfont TAG cfont SET ORDER TO TAG cfont GO TOP m.cn_preprta=cafonts.cfont thisform.combo2.requery() thisform.combo2.refresh() thisform.text1.click() DODEFAULT() ENDPROC PROCEDURE combo1.Valid *!* THISFORM.text1.fontname=thisform.combo1.value *!* THISFORM.text1.value="This is an example of the font "+thisform.combo1.value *!* THISFORM.text1.fontsize=11 *!* THISFORM.text1.refresh() DODEFAULT() THISFORM.text1.click() ENDPROC PROCEDURE text1.Click THIS.value="This is an example of the font "+thisform.combo1.value This.fontname=thisform.combo1.value thisform.refresh() DODEFAULT() ENDPROC ENDDEFINETracy
>>THIS.value="This is an example of the font "+thisform.combo1.value >>This.fontname=thisform.combo1.value >>this.refresh() >>>>