|
|
|
|
|
SftOptionsHeader.Font Property |
Defines the text font used for the header.
Syntax
|
VB.NET |
refFontObj = object.Font As stdole.IFontDisp |
||
|
VB |
Set refFontObj = object.Font As IFontDisp |
||
|
C#.NET |
stdole.IFontDisp refFontObj = object.Font; |
||
|
VC++ |
IFontDisp* refFontObj = object->GetFont(); |
||
|
C |
HRESULT object->get_Font(IFontDisp** refFontObj); |
||
|
Delphi |
refFontObj := object.Font : IFontDisp; |
||
|
VB.NET |
object.let_Font(ByVal refFontObj As stdole.IFontDisp) |
||
|
VB |
object.Font = refFontObj As IFontDisp |
||
|
C#.NET |
void object.let_Font(stdole.IFontDisp refFontObj); |
||
|
VC++ |
void object->PutFont(IFontDisp* refFontObj); |
||
|
C |
HRESULT object->put_Font(IFontDisp* refFontObj); |
||
|
Delphi |
procedure object._Set_Font(refFontObj : IFontDisp); |
||
|
VB.NET |
object.Font = refFontObj As stdole.IFontDisp |
||
|
VB |
Set object.Font = refFontObj As IFontDisp |
||
|
C#.NET |
stdole.IFontDisp object.Font = refFontObj; |
||
|
VC++ |
void object->PutRefFont(IFontDisp* refFontObj); |
||
|
C |
HRESULT object->putref_Font(IFontDisp* refFontObj); |
||
|
Delphi |
object.Font := refFontObj : IFontDisp; |
||
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 SftOptions.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