Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Font properties for RTF olecontrol
Message
 
To
16/07/2006 10:27:20
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01136777
Message ID:
01136779
Views:
13
>Does anyone know how I can programmatically set the default font size/name for an RTF olecontrol? In the property sheet the .font property shows as 'object', which I can set manually, but I would like to set font attributes programmatically for a number of similar controls on a form.
>
>Much of the data displayed in the control already has embedded RTF markup data, and these font attributes display fine, but some of the data is plain text, which I would like displayed in a user-selected default font and size.
>
>Any help would be appreciated.
>
>Alan

Alan try this code
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


	**************************************************
*-- Form:         form1 (f:\wda\form3.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   07/16/06 06:21:01 PM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "form1"

    ADD OBJECT ortf AS olecontrol WITH ;
        OLEClass = "RICHTEXT.RichtextCtrl.1", ;
		Top = 21, ;
		Left = 30, ;
		Height = 110, ;
		Width = 294, ;
		Name = "ortf"


	PROCEDURE Init
		m.myfont = "Fixedsys"
		m.mysize = 20
		Thisform.oRtf.oBJECT.SelStart = 0
		Thisform.oRtf.oBJECT.SelLength = LEN(Thisform.orTF.text)
		Thisform.oRtf.oBJECT.SelFontName =  m.myfont
		Thisform.oRtf.oBJECT.SelFontSize =  m.mysize
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
HTH
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform