Hide

SftOptions 1.0 - ActiveX Options Control

Display
Print

SftOptionsHeader.Font Property

Defines the text font used for the header.

Syntax

Get

VB.NETrefFontObj = object.Font As stdole.IFontDisp
VBSet refFontObj = object.Font As IFontDisp
C#.NETstdole.IFontDisp refFontObj = object.Font;
VC++IFontDisp* refFontObj = object->GetFont();
CHRESULT object->get_Font(IFontDisp** refFontObj);

Put

VB.NETobject.let_Font(ByVal refFontObj As stdole.IFontDisp)
VBobject.Font = refFontObj As IFontDisp
C#.NETvoid object.let_Font(stdole.IFontDisp refFontObj);
VC++void object->PutFont(IFontDisp* refFontObj);
CHRESULT object->put_Font(IFontDisp* refFontObj);

PutRef

VB.NETobject.Font = refFontObj As stdole.IFontDisp
VBSet object.Font = refFontObj As IFontDisp
C#.NETstdole.IFontDisp object.Font = refFontObj;
VC++void object->PutRefFont(IFontDisp* refFontObj);
CHRESULT object->putref_Font(IFontDisp* refFontObj);

object

A SftOptionsHeader object.

refFontObj

Defines the text font used for the header.

Comments

The Font property defines the text font used for the header.

The control's Font property is used to define the font for entries.

Using PutRef (see Syntax above) the control will use the reference to the Font object. If the Font object is later changed, this will also affect the font used by the control. Using Put instead causes the control to create a copy of the Font object. If the Font object is later changed, this will not affect the font used by the control as it uses a copy of the object. Because of the additional overhead and the increased resource use of Put, PutRef is the preferred method.

Example (VB.NET)

Dim ItalFont As New Font("Times New Roman", 12, FontStyle.Italic)
AxSftOptions1.Header.Font = OLECvt.ToOLE_IFontDisp(ItalFont)
AxSftOptions1.Header.Style = SftOptionsHeaderStyleConstants.headerSftOptionsButton
AxSftOptions1.Header.Text = "Options"
AxSftOptions1.Add("", "Topic1", "Sample Topic", SftOptionsEntryConstants.entrySftOptionsTopic, "", "", Nothing, "", "", "", "")
AxSftOptions1.InitializationComplete()

Example (VB)

SftOptions1.Header.Font.Name = "Times New Roman"
SftOptions1.Header.Font.Italic = True
SftOptions1.Header.Font.Size = 12
SftOptions1.Header.Style = headerSftOptionsButton
SftOptions1.Header.Text = "Options"
SftOptions1.Add "", "Topic1", "Sample Topic", entrySftOptionsTopic, "", "", Nothing, "", "", "", ""
SftOptions1.InitializationComplete

Example (C#.NET)

Font ItalFont = new Font("Times New Roman", 12, FontStyle.Italic);
axSftOptions1.Header.Font = OLECvt.ToOLE_IFontDisp(ItalFont);
axSftOptions1.Header.Style = SftOptionsHeaderStyleConstants.headerSftOptionsButton;
axSftOptions1.Header.Text = "Options";
axSftOptions1.Add("", "Topic1", "Sample Topic", SftOptionsEntryConstants.entrySftOptionsTopic, "", "", null, "", "", "", "");
axSftOptions1.InitializationComplete();

Example (VC++)

ISftOptionsPtr vOptions1 = m_Options1.GetControlUnknown();

IFontDispPtr pFontDisp = vOptions1->Header->GetFont();
IFontPtr pFont = pFontDisp;
pFont->put_Name(L"Times New Roman");
CY size;
size.int64 = 12*10000L; //10 point font
pFont->put_Size(size);
pFont->put_Italic(TRUE);

vOptions1->Header->Style = headerSftOptionsButton;
vOptions1->Header->Text = "Options";

vOptions1->Add(_bstr_t(""), _bstr_t("Topic1"), _bstr_t("Sample Topic"),
	entrySftOptionsTopic, _bstr_t(""), _bstr_t(""), NULL,
	_bstr_t(""), _bstr_t(""), _bstr_t(""), _bstr_t(""));
vOptions1->InitializationComplete();

Example (Delphi)

//var f : TFont;
f := TFont.Create();
SetOleFont(f, SftOptions1.Header.Font);
f.Name := 'Times New Roman';
f.Size := 12;
f.Style := [fsItalic];
SftOptions1.Header.Style := headerSftOptionsButton;
SftOptions1.Header.Text := 'Options';
SftOptions1.Add('', 'Topic1', 'Sample Topic', entrySftOptionsTopic, '', '', nil, '', '', '', '');
SftOptions1.InitializationComplete();

See Also SftOptionsHeader Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.