SftOptions 1.0

SftOptions.Font Property

Softel vdm, Inc.

Defines the default entry font.

Syntax       

Get

VB.NET

refFontObj = object.Font  As System.Drawing.Font
refFontObj = object.Font  As stdole.IFontDisp  Note

VB

Set refFontObj = object.Font  As IFontDisp

C#.NET

System.Drawing.Font refFontObj = object.Font;
stdole.IFontDisp refFontObj = object.Font;  Note

VC++

IFontDisp* refFontObj = object->GetFont();

C

HRESULT object->get_Font(IFontDisp** refFontObj);

Delphi

refFontObj := object.Font  : TFont;
refFontObj := object.Font  : IFontDisp;  Note

Put

VB.NET

object.let_Font(ByVal refFontObj As stdole.IFontDisp)  Note

VB

object.Font = refFontObj  As IFontDisp

C#.NET

void object.let_Font(stdole.IFontDisp refFontObj);  Note

VC++

void object->PutFont(IFontDisp* refFontObj);

C

HRESULT object->put_Font(IFontDisp* refFontObj);

Delphi

procedure object._Set_Font(refFontObj : IFontDisp);  Note

PutRef

VB.NET

object.Font = refFontObj  As System.Drawing.Font
object.Font = refFontObj  As stdole.IFontDisp  Note

VB

Set object.Font = refFontObj  As IFontDisp

C#.NET

System.Drawing.Font object.Font = refFontObj;
stdole.IFontDisp object.Font = refFontObj;  Note

VC++

void object->PutRefFont(IFontDisp* refFontObj);

C

HRESULT object->putref_Font(IFontDisp* refFontObj);

Delphi

object.Font := refFontObj  : TFont;
object.Font := refFontObj  : IFontDisp;  Note

object

A SftOptions object.

refFontObj

Defines the default entry font.

Comments

The Font property defines the default entry font.

If an entry has been modified by the end-user and the new settings have not yet been saved (using SftOptions.Save), the entry uses the ModifiedFont property instead.

The font used for the header is defined using the SftOptionsHeader.Font property.

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 ItalicFont As New Font("Times New Roman", 12, FontStyle.Italic)
AxSftOptions1.Font = ItalicFont
AxSftOptions1.Add("", "Topic1", "Sample Topic", _
     SftOptionsEntryConstants.entrySftOptionsTopic, _
     "", "", Nothing, "", "", "", "")
AxSftOptions1.InitializationComplete()

Example (VB)

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

Example (C#.NET)

Font ItalicFont = new Font("Times New Roman", 12, FontStyle.Italic);
axSftOptions1.Font = ItalicFont;
axSftOptions1.Add("", "Topic1", "Sample Topic", 
    SftOptionsEntryConstants.entrySftOptionsTopic,
     "", "", null, "", "", "", "");
axSftOptions1.InitializationComplete();

Example (VC++)

ISftOptionsPtr vOptions1 = m_Options1.GetControlUnknown();

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

pFontDisp = vOptions1->GetModifiedFont();
pFont = pFontDisp;
pFont->put_Name(L"Times New Roman");
size.int64 = 10*10000L; //10 point font
pFont->put_Size(size);
pFont->put_Bold(TRUE);

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->Add(_bstr_t("Topic1"), _bstr_t("Cb1"), _bstr_t("Check Box 1"), 
    entrySftOptionsCheckBox, _bstr_t(""), _bstr_t(""), NULL,
    _bstr_t(""), _bstr_t(""), _bstr_t(""), _bstr_t(""));
vOptions1->Add(_bstr_t("Topic1"), _bstr_t("Cb2"), _bstr_t("Check Box 2"), 
    entrySftOptionsCheckBox, _bstr_t(""), _bstr_t(""), NULL,
    _bstr_t(""), _bstr_t(""), _bstr_t(""), _bstr_t(""));
vOptions1->Add(_bstr_t("Topic1"), _bstr_t("Cb3"), _bstr_t("Check Box 3"), 
    entrySftOptionsCheckBox, _bstr_t(""), _bstr_t(""), NULL,
    _bstr_t(""), _bstr_t(""), _bstr_t(""), _bstr_t(""));
vOptions1->InitializationComplete();

Example (Delphi)

SftOptions1.Add('', 'Topic1', 'Sample Topic', entrySftOptionsTopic, '', '', nil, '', '', '', '');
SftOptions1.Font.Name := 'Times New Roman';
SftOptions1.Font.Style := [ fsItalic ];
SftOptions1.Font.Size := 12;
SftOptions1.InitializationComplete();

See Also  SftOptions Object | Object Hierarchy


Feedback / comments / error reports for this topic
© 2002 - Softel vdm, Inc. - www.softelvdm.com