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
This sample illustrates cell fonts.
The source code is located at C:\Program Files (x86)\Softelvdm\SftTree OCX 7.5\Samples\Visual Studio - CSharp\ListFont\Form1.cs or C:\Program Files\Softelvdm\SftTree OCX 7.5\Samples\Visual Studio - CSharp\ListFont\Form1.cs (on 32-bit Windows versions).
private void closeButton_Click(object sender, System.EventArgs e) {
Application.Exit();
}
private void axSftTree1_ItemDblClick(object sender, AxSftTreeLib75._DSftTreeEvents_ItemDblClickEvent e) {
if (e.areaType == (short) SftTreeAreaTypeConstants.constSftTreeColumnRes) {
axSftTree1.get_Column(e.colIndex).MakeOptimal();
axSftTree1.Items.RecalcHorizontalExtent();
}
}
private void Form1_Load(object sender, System.EventArgs e) {
axSftTree1.BulkUpdate = true;
// Add all screen fonts to the tree control
int ScreenIndex = axSftTree1.Items.Add("Fonts");
axSftTree1.get_Item(ScreenIndex).Level = 0;
// display fonts
int counter = 0;
foreach (FontFamily ff in System.Drawing.FontFamily.Families) {
// add font name
Font newFont = null;
try {
newFont = new Font(ff.Name, 8);
} catch {
newFont = null;
}
if (newFont != null) {
if (++counter > 50) // only add up to 50
break;
int itemIndex = axSftTree1.Items.Add(ff.Name);
axSftTree1.get_Item(itemIndex).Level = 1;
// set the font
axSftTree1.get_Cell(itemIndex, 0).Font = OLECvt.ToIFontDisp(newFont);
// set the font name in column 1
axSftTree1.get_Cell(itemIndex, 1).Text = ff.Name;
}
}
axSftTree1.BulkUpdate = false;
// make column widths optimal
axSftTree1.ColumnsObj.MakeOptimal();
// allow horizontal scrolling
axSftTree1.Items.RecalcHorizontalExtent();
}
}
}