SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Adds a list of available font sizes.
VB.NET | Count = object.AddFontSizes(ByVal FontName As String, ByVal hDCPrinter As Integer) As Integer |
VB | Count = object.AddFontSizes(ByVal FontName As String, ByVal hDCPrinter As Long) As Long |
C#.NET | int Count = object.AddFontSizes(string FontName, int hDCPrinter); |
VC++ | long Count = object->AddFontSizes(_bstr_t FontName, long hDCPrinter); |
C | HRESULT object->raw_AddFontSizes(BSTR FontName, long hDCPrinter, long* Count); |
object
FontName
The name of the font whose font sizes are to be added to the control.
hDCPrinter
Specify a valid printer device context handle if the font FontName is a printer font. Specify 0 for screen fonts.
Count
Returns the number of font sizes added to the control.
The AddFontSizes method adds a list of available font sizes.
The AddFontSizes method adds all available font sizes (in points) of the font FontName to the combo box as items. The combo box is cleared first.
Font sizes are added in ascending order.
The Cell.Data property of the cell in column 0 of each item will contain the font size, which could be used for sorting purposes.
The drop down portion is automatically hidden when the combo box contents are changed using this method. The DropDown.SuppressOn method can be used to suppress hiding the drop down portion when adding/inserting items.
fontStyles.Columns.MakeOptimal(0) fontStyles.Items.RecalcHorizontalExtent(0) End Sub Private Sub UpdateFontSizes() ' add all sizes for the current font name If fontNames.Items.Selection >= 0 Then Dim OldText As String = fontSizes.Edit.Text fontSizes.Items.AddFontSizes(fontNames.get_Cell(fontNames.Items.Selection, 0).Text, 0) Dim index As Integer = fontSizes.Items.Find(OldText, 0, 0, False, True, True) If index < 0 Then index = 0 fontSizes.Items.Selection = index Else fontSizes.Items.Clear() End If PerformSort(fontSizes, SftBoxSortConstants.sortSftBoxAscending)
End If End Sub Private Sub UpdateSizes() Dim OldText As String, Index As Long ' add all sizes for the current font name If FontNames.Items.Selection >= 0 Then OldText = FontSizes.Edit.Text FontSizes.Items.AddFontSizes FontNames.Cell(FontNames.Items.Selection, 0).Text, 0 Index = FontSizes.Items.Find(OldText, 0, 0, False, True, True) If Index < 0 Then Index = 0 FontSizes.Items.Selection = Index Else FontSizes.Items.Clear End If PerformCellValueSort FontSizes
fontStyles.Items.RecalcHorizontalExtent(0); } private void UpdateFontSizes() { // add all sizes for the current font name if (fontNames.Items.Selection >= 0) { string OldText = fontSizes.Edit.Text; fontSizes.Items.AddFontSizes(fontNames.get_Cell(fontNames.Items.Selection,0).Text, 0); int index = fontSizes.Items.Find(OldText, 0, 0, false, true, true); if (index < 0) index = 0; fontSizes.Items.Selection = index; } else fontSizes.Items.Clear(); PerformSort(fontSizes, SftBoxSortConstants.sortSftBoxAscending); fontSizes.Columns.MakeOptimal(0);
void CFontDlgDlg::UpdateFontSizes() { // add all sizes for the current font name ISftBoxPtr vFontNames = m_FontNames.GetControlUnknown(); ISftBoxPtr vFontSizes = m_FontSizes.GetControlUnknown(); if (vFontNames->Items->Selection >= 0) { CString OldText((LPCTSTR) vFontSizes->Edit->Text); vFontSizes->Items->AddFontSizes(vFontNames->Cell[vFontNames->Items->Selection][0]->Text, 0); long index; vFontSizes->Items->raw_Find((_bstr_t)OldText, 0, 0, VARIANT_FALSE, VARIANT_TRUE, VARIANT_TRUE, &index); if (index < 0) index = 0; vFontSizes->Items->Selection = index; } else vFontSizes->Items->Clear(); PerformSortSize(vFontSizes, sortSftBoxAscending);
See Also SftBoxItems Object | Object Hierarchy