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
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
SftTree/NET 2.0 - Tree Control
This sample illustrates using bitmaps, images, imagelists, checkboxes, radiobuttons, color samples, progress bars and more, hosting SftTree/OCX in a .NET 10 Windows Forms application.
It is the C# Pictures Sample ported to .NET 10. Because the .NET Framework SftHelperComponent and OLECvt class are not available in .NET 10, this version assigns images using the control's native API (such as LoadImage) instead.
The source code is located at C:\Program Files\Softelvdm\SftTree OCX 8.0\Samples\Visual Studio - CSharp .NET 10\Pictures\Form1.cs.
// SftTree/OCX 8.0 "Pictures" sample, .NET 10 port. .NET 10 has no BinaryFormatter, so the tree is // configured in code (not designer OcxState) and images load via ISftPictureObject.LoadImage. using System; using System.Drawing; using System.IO; using System.Windows.Forms; using SftTreeLib80; using AxSftTreeLib80; namespace Pictures { public partial class Form1 : Form { private bool m_SortDirection; private System.Windows.Forms.Timer progressTimer; private ImageList imageList1; public Form1() { InitializeComponent(); InitializeSftTreeSample(); } private void exitMenuItem_Click(object sender, EventArgs e) { Application.Exit(); } private static string ImagePath(string file) { return Path.Combine(AppContext.BaseDirectory, "Resources", file); } // Called from the constructor after InitializeComponent(). private void InitializeSftTreeSample() { axSftTree1.ItemClick += new AxSftTreeLib80._DSftTreeEvents_ItemClickEventHandler(this.axSftTree1_ItemClick); axSftTree1.ItemDblClick += new AxSftTreeLib80._DSftTreeEvents_ItemDblClickEventHandler(this.axSftTree1_ItemDblClick); axSftTree1.SelectionChange += new System.EventHandler(this.axSftTree1_SelectionChange); this.Load += new EventHandler(this.Form1_Load); // Create the container the designer omits (this form has no designer-managed components). if (this.components == null) this.components = new System.ComponentModel.Container(); progressTimer = new System.Windows.Forms.Timer(this.components); progressTimer.Interval = 300; progressTimer.Enabled = true; progressTimer.Tick += new EventHandler(this.timer1_Tick); // ImageList demo source, built in code. imageList1 = new ImageList(); imageList1.ColorDepth = ColorDepth.Depth32Bit; imageList1.ImageSize = new Size(16, 16); foreach (string f in new string[] { "pic_warn_32.png", "pic_world_48.png", "Smile1.bmp" }) { string p = ImagePath(f); if (File.Exists(p)) imageList1.Images.Add(Image.FromFile(p)); } } private void CopyImageFromCurrentItem() { int itemIndex = axSftTree1.Items.Current; if (itemIndex < 0) return; // don't use images that are too large in the other areas SftPictureObject img = axSftTree1.get_Cell(itemIndex, 0).Image; if (img.ActualHeight <= 20 && img.ActualWidth <= 20) { axSftTree1.RowColumnHeader.Image = img; axSftTree1.get_Header(1).Image = img; } else { axSftTree1.RowColumnHeader.Image.Clear(); axSftTree1.get_Header(1).Image.Clear(); } } private void ToggleImage(SftPictureObject img) { switch (img.Appearance) { case SftPictureImageConstants.sftImageCheckboxNo: img.Appearance = SftPictureImageConstants.sftImageCheckboxYes; break; case SftPictureImageConstants.sftImageCheckboxYes: img.Appearance = SftPictureImageConstants.sftImageCheckboxNo; break; case SftPictureImageConstants.sftImageCheckboxUnknown: img.Appearance = SftPictureImageConstants.sftImageCheckboxNo; break; case SftPictureImageConstants.sftImageCheckboxNoDisabled: img.Appearance = SftPictureImageConstants.sftImageCheckboxYesDisabled; break; case SftPictureImageConstants.sftImageCheckboxYesDisabled: img.Appearance = SftPictureImageConstants.sftImageCheckboxNoDisabled; break; case SftPictureImageConstants.sftImageCheckboxUnknownDisabled: img.Appearance = SftPictureImageConstants.sftImageCheckboxNoDisabled; break; case SftPictureImageConstants.sftImageRadioButtonNo: img.Appearance = SftPictureImageConstants.sftImageRadioButtonYes; break; case SftPictureImageConstants.sftImageRadioButtonYes: img.Appearance = SftPictureImageConstants.sftImageRadioButtonNo; break; case SftPictureImageConstants.sftImageRadioButtonNoDisabled: img.Appearance = SftPictureImageConstants.sftImageRadioButtonYesDisabled; break; case SftPictureImageConstants.sftImageRadioButtonYesDisabled: img.Appearance = SftPictureImageConstants.sftImageRadioButtonNoDisabled; break; case SftPictureImageConstants.sftImageUp: img.Appearance = SftPictureImageConstants.sftImageDown; break; case SftPictureImageConstants.sftImageUpDisabled: img.Appearance = SftPictureImageConstants.sftImageDownDisabled; break; case SftPictureImageConstants.sftImageDown: img.Appearance = SftPictureImageConstants.sftImageUp; break; case SftPictureImageConstants.sftImageDownDisabled: img.Appearance = SftPictureImageConstants.sftImageUpDisabled; break; case SftPictureImageConstants.sftImageSortAsc: img.Appearance = SftPictureImageConstants.sftImageSortDesc; break; case SftPictureImageConstants.sftImageSortAscDisabled: img.Appearance = SftPictureImageConstants.sftImageSortDescDisabled; break; case SftPictureImageConstants.sftImageSortDesc: img.Appearance = SftPictureImageConstants.sftImageSortAsc; break; case SftPictureImageConstants.sftImageSortDescDisabled: img.Appearance = SftPictureImageConstants.sftImageSortAscDisabled; break; } } private void PropagateImage(int itemIndex, SftPictureObject img) { // don't use images that are too large in the other areas if (img.ActualHeight <= 20 && img.ActualWidth < 20) { axSftTree1.get_Item(itemIndex).Image = img; axSftTree1.get_Item(itemIndex).LabelImage = img; axSftTree1.get_Item(itemIndex).RowHeader.Image = img; } } // Load an image file into the cell picture (GDI+). private void UpdateImageFile(int itemIndex, string file, SftTreeHAlignConstants align) { SftTreeCell c = axSftTree1.get_Cell(itemIndex, 0); c.Image.LoadImage(ImagePath(file), false); c.ImageHAlign = align; PropagateImage(itemIndex, c.Image); } private void UpdateImageList(int itemIndex, ImageList imageListControl, int i, SftTreeHAlignConstants align) { SftTreeCell c = axSftTree1.get_Cell(itemIndex, 0); c.Image.SetImageListH((long) imageListControl.Handle, (short) i); c.ImageHAlign = align; PropagateImage(itemIndex, c.Image); } private void UpdateColor(int itemIndex, System.Drawing.Color clr, SftTreeHAlignConstants align) { SftTreeCell c = axSftTree1.get_Cell(itemIndex, 0); c.Image.SetColorSample((uint) ColorTranslator.ToOle(clr), (uint) ColorTranslator.ToOle(Color.Black)); c.Image.Width = 12; c.Image.Height = 12; c.ImageHAlign = align; PropagateImage(itemIndex, c.Image); } private void AddColor(string text, Color clr) { int i = axSftTree1.Items.Add(text); axSftTree1.get_Item(i).Level = 2; UpdateColor(i, clr, SftTreeHAlignConstants.halignSftTreeRight); } private void UpdateBuiltinImage(int itemIndex, SftPictureImageConstants style, int wPix, int hPix, SftTreeHAlignConstants align) { SftTreeCell c = axSftTree1.get_Cell(itemIndex, 0); c.Image.Appearance = style; c.Image.Width = wPix; c.Image.Height = hPix; c.ImageHAlign = align; PropagateImage(itemIndex, c.Image); } private void AddBuiltinImage(string text, SftPictureImageConstants style, int wPix, int hPix) { int i = axSftTree1.Items.Add(text); axSftTree1.get_Item(i).Level = 2; UpdateBuiltinImage(i, style, wPix, hPix, SftTreeHAlignConstants.halignSftTreeRight); } private void ShowSortDirection(bool ascending) { if (ascending) axSftTree1.get_Header(0).Image.Appearance = SftPictureImageConstants.sftImageSortAsc; else axSftTree1.get_Header(0).Image.Appearance = SftPictureImageConstants.sftImageSortDesc; m_SortDirection = ascending; } private void SetSortDirection(bool newDirection) { ShowSortDirection(newDirection); if (newDirection) axSftTree1.Items.SortDependents(-1, 0, SftTreeSortTypeConstants.sortSftTreeAscending); else axSftTree1.Items.SortDependents(-1, 0, SftTreeSortTypeConstants.sortSftTreeDescending); } private void Form1_Load(object sender, System.EventArgs e) { axSftTree1.Dock = DockStyle.Fill; int itemIndex = axSftTree1.Items.Add("Progress Bars"); axSftTree1.get_Cell(itemIndex, 1).Text = "SftTree/OCX supports progress bars as cell background (partial or full size)."; int i = axSftTree1.Items.Add("Progress Bar - Full Size"); axSftTree1.get_Item(i).Level = 1; axSftTree1.get_Cell(i, 0).ProgressMax = 100; // maximum value 0-100 axSftTree1.get_Cell(i, 0).ProgressValue = 33; // current value i = axSftTree1.Items.Add("Progress Bar - Partial"); axSftTree1.get_Item(i).Level = 1; axSftTree1.get_Cell(i, 0).ProgressColorOrientation = SftTreeOrientationDefaultConstants.horizontalDefaultOrientationSftTree; axSftTree1.get_Cell(i, 0).ProgressStyle = SftTreeProgressStyleDefaultConstants.smallDefaultProgressStyleSftTree; axSftTree1.get_Cell(i, 0).ProgressMax = 200; // maximum value 0-200 axSftTree1.get_Cell(i, 0).ProgressValue = 33; // current value i = axSftTree1.Items.Add("Progress Bar - with gradient fill"); axSftTree1.get_Item(i).Level = 1; axSftTree1.get_Cell(i, 0).ProgressColorOrientation = SftTreeOrientationDefaultConstants.horizontalDefaultOrientationSftTree; axSftTree1.get_Cell(i, 0).ProgressStyle = SftTreeProgressStyleDefaultConstants.smallDefaultProgressStyleSftTree; axSftTree1.get_Cell(i, 0).ProgressColor = (uint) ColorTranslator.ToOle(Color.FromArgb(128, 128, 0)); axSftTree1.get_Cell(i, 0).ProgressColorEnd = (uint) ColorTranslator.ToOle(Color.FromArgb(255, 255, 0)); axSftTree1.get_Cell(i, 0).ProgressMax = 50; // maximum value 0-50 axSftTree1.get_Cell(i, 0).ProgressValue = 40; // current value i = axSftTree1.Items.Add("Progress Bar - customizable colors"); axSftTree1.get_Item(i).Level = 1; axSftTree1.get_Cell(i, 0).ProgressColorOrientation = SftTreeOrientationDefaultConstants.verticalDefaultOrientationSftTree; axSftTree1.get_Cell(i, 0).ProgressStyle = SftTreeProgressStyleDefaultConstants.smallDefaultProgressStyleSftTree; axSftTree1.get_Cell(i, 0).ProgressColor = (uint) ColorTranslator.ToOle(Color.FromArgb(128, 128, 0)); axSftTree1.get_Cell(i, 0).ProgressColorEnd = (uint) ColorTranslator.ToOle(Color.FromArgb(255, 255, 0)); axSftTree1.get_Cell(i, 0).ProgressMax = 150; // maximum value 0-150 axSftTree1.get_Cell(i, 0).ProgressValue = 40; // current value axSftTree1.get_Cell(i, 0).BackColor = (uint) ColorTranslator.ToOle(Color.FromKnownColor(KnownColor.Window)); axSftTree1.get_Cell(i, 0).BackColorEnd = (uint) ColorTranslator.ToOle(Color.FromArgb(255, 0, 0)); axSftTree1.get_Cell(i, 0).BackColorOrientation = SftTreeOrientationDefaultConstants.horizontalDefaultOrientationSftTree; itemIndex = axSftTree1.Items.Add("Supported Picture Types"); axSftTree1.get_Cell(itemIndex, 1).Text = "SftTree/OCX supports numerous image types, such as GDI+, bitmaps, icons, ImageLists and also offers numerous built-in images."; // GDI+ samples itemIndex = axSftTree1.Items.Add("GDI+ Images"); axSftTree1.get_Item(itemIndex).Level = 1; axSftTree1.get_Cell(itemIndex, 1).Text = "All GDI+ images are supported, like GIF, JPEG, Exif, PNG, TIFF and device-independent bitmaps (up to 64bpp) with semi-transparent and translucent areas."; i = axSftTree1.Items.Add("PNG Sample with alpha-channel for translucent edges"); axSftTree1.get_Item(i).Level = 2; UpdateImageFile(i, "pic_warn_32.png", SftTreeHAlignConstants.halignSftTreeRight); i = axSftTree1.Items.Add("Another PNG Sample with alpha-channel for translucent edges"); axSftTree1.get_Item(i).Level = 2; UpdateImageFile(i, "pic_world_48.png", SftTreeHAlignConstants.halignSftTreeRight); // bitmap samples itemIndex = axSftTree1.Items.Add("Bitmaps"); axSftTree1.get_Item(itemIndex).Level = 1; axSftTree1.get_Cell(itemIndex, 1).Text = "Bitmaps can be of varying sizes and also support Bitmap Transparency, which allows the background to show through the image (in areas selected by the bitmap designer)."; i = axSftTree1.Items.Add("Large Bitmap"); axSftTree1.get_Item(i).Level = 2; UpdateImageFile(i, "logo3.bmp", SftTreeHAlignConstants.halignSftTreeRight); i = axSftTree1.Items.Add("Various bitmap sizes"); axSftTree1.get_Item(i).Level = 2; UpdateImageFile(i, "Smile1.bmp", SftTreeHAlignConstants.halignSftTreeRight); // icon samples itemIndex = axSftTree1.Items.Add("Icons"); axSftTree1.get_Item(itemIndex).Level = 1; axSftTree1.get_Cell(itemIndex, 1).Text = "The supported icons can be standard size icons (32x32) or any other size supported by the operating system."; i = axSftTree1.Items.Add("Standard Icon (32x32)"); axSftTree1.get_Item(i).Level = 2; UpdateImageFile(i, "Pictures.ico", SftTreeHAlignConstants.halignSftTreeRight); i = axSftTree1.Items.Add("Any other size"); axSftTree1.get_Item(i).Level = 2; UpdateImageFile(i, "App.ico", SftTreeHAlignConstants.halignSftTreeRight); // imagelist samples itemIndex = axSftTree1.Items.Add("ImageLists"); axSftTree1.get_Item(itemIndex).Level = 1; axSftTree1.get_Cell(itemIndex, 1).Text = "Complete ImageList support simplifies bitmap handling and can avoid the limited resource availability on earlier Windows versions."; for (int c = 0 ; c < imageList1.Images.Count ; ++c) { i = axSftTree1.Items.Add("Image " + c.ToString()); axSftTree1.get_Item(i).Level = 2; UpdateImageList(i, imageList1, c, SftTreeHAlignConstants.halignSftTreeRight); } // color samples itemIndex = axSftTree1.Items.Add("Color Samples"); axSftTree1.get_Item(itemIndex).Level = 1; axSftTree1.get_Cell(itemIndex, 1).Text = "Using the built-in color sample image, simple color selection can easily be implemented. Color samples can display all colors available."; AddColor("Black", System.Drawing.Color.Black); AddColor("Blue", System.Drawing.Color.Blue); AddColor("Cyan", System.Drawing.Color.Cyan); AddColor("Green", System.Drawing.Color.Lime); AddColor("Magenta", System.Drawing.Color.Magenta); AddColor("Red", System.Drawing.Color.Red); AddColor("White", System.Drawing.Color.White); AddColor("Yellow", System.Drawing.Color.Yellow); AddColor("3DDKSHADOW - Dark shadow for 3D elements", System.Drawing.SystemColors.ControlDarkDark); AddColor("3DFACE - Face color for 3D elements", System.Drawing.SystemColors.Control); AddColor("3DHILIGHT - Edges facing the light source", System.Drawing.SystemColors.ControlLightLight); AddColor("3DLIGHT - Edges facing the light source", System.Drawing.SystemColors.ControlLight); AddColor("3DSHADOW - Edges facing away from the light source", System.Drawing.SystemColors.ControlDark); AddColor("INFOBK - Background color for tooltip controls", System.Drawing.SystemColors.Info); AddColor("INFOTEXT - text color for tooltip controls", System.Drawing.SystemColors.InfoText); AddColor("MENUTEXT - text in menus", System.Drawing.SystemColors.MenuText); AddColor("ACTIVEBORDER - Active window border", System.Drawing.SystemColors.ActiveBorder); AddColor("ACTIVECAPTION - Active window caption", System.Drawing.SystemColors.ActiveCaption); AddColor("APPWORKSPACE - Background color MDI applications", System.Drawing.SystemColors.AppWorkspace); AddColor("BACKGROUND - Desktop", System.Drawing.SystemColors.Desktop); AddColor("BTNFACE - Face shading on push buttons", System.Drawing.SystemColors.Control); AddColor("BTNHILIGHT - Highlight color for buttons", System.Drawing.SystemColors.ControlLightLight); AddColor("BTNSHADOW - Edge shading on push buttons", System.Drawing.SystemColors.ControlDark); AddColor("BTNTEXT - text on push buttons", System.Drawing.SystemColors.ControlText); AddColor("CAPTIONTEXT - text in caption", System.Drawing.SystemColors.ActiveCaptionText); AddColor("GRAYTEXT - Grayed (disabled) text", System.Drawing.SystemColors.GrayText); AddColor("HIGHLIGHT - Selected Item(s)", System.Drawing.SystemColors.Highlight); AddColor("HIGHLIGHTTEXT - text of selected item(s)", System.Drawing.SystemColors.HighlightText); AddColor("INACTIVEBORDER - Inactive window border", System.Drawing.SystemColors.InactiveBorder); AddColor("INACTIVECAPTION - Inactive window caption", System.Drawing.SystemColors.InactiveCaption); AddColor("INACTIVECAPTIONTEXT - Inactive caption text color", System.Drawing.SystemColors.InactiveCaptionText); AddColor("MENU - Menu background", System.Drawing.SystemColors.Menu); AddColor("SCROLLBAR - Scroll bar gray area", System.Drawing.SystemColors.ScrollBar); AddColor("WINDOW - Window background", System.Drawing.SystemColors.Window); AddColor("WINDOWFRAME - Window frame", System.Drawing.SystemColors.WindowFrame); AddColor("WINDOWTEXT - text in windows", System.Drawing.SystemColors.WindowText); // predefined image samples itemIndex = axSftTree1.Items.Add("Predefined (Built-in) Pictures"); axSftTree1.get_Cell(itemIndex, 1).Text = "Predefined images are available for commonly used items, such as check boxes, radio buttons, sort direction indicators and more..."; itemIndex = axSftTree1.Items.Add("Check Boxes - Honors Windows Themes"); axSftTree1.get_Item(itemIndex).Level = 1; AddBuiltinImage("Enabled, Selected Check Box", SftPictureImageConstants.sftImageCheckboxYes, 14, 14); AddBuiltinImage("Disabled, Selected Check Box", SftPictureImageConstants.sftImageCheckboxYesDisabled, 14, 14); AddBuiltinImage("Enabled Check Box", SftPictureImageConstants.sftImageCheckboxNo, 14, 14); AddBuiltinImage("Disabled Check Box", SftPictureImageConstants.sftImageCheckboxNoDisabled, 14, 14); AddBuiltinImage("Enabled, Unknown Check Box", SftPictureImageConstants.sftImageCheckboxUnknown, 14, 14); AddBuiltinImage("Disabled, Unknown Check Box", SftPictureImageConstants.sftImageCheckboxUnknownDisabled, 14, 14); itemIndex = axSftTree1.Items.Add("Radio Buttons - Honors Windows Themes"); axSftTree1.get_Item(itemIndex).Level = 1; AddBuiltinImage("Enabled, Selected Radio Button", SftPictureImageConstants.sftImageRadioButtonYes, 14, 14); AddBuiltinImage("Disabled, Selected Radio Button", SftPictureImageConstants.sftImageRadioButtonYesDisabled, 14, 14); AddBuiltinImage("Enabled Radio Button", SftPictureImageConstants.sftImageRadioButtonNo, 14, 14); AddBuiltinImage("Disabled Radio Button", SftPictureImageConstants.sftImageRadioButtonNoDisabled, 14, 14); itemIndex = axSftTree1.Items.Add("Up/Down Buttons - Honors Windows Themes"); axSftTree1.get_Item(itemIndex).Level = 1; AddBuiltinImage("Enabled Up Button", SftPictureImageConstants.sftImageUp, 14, 14); AddBuiltinImage("Disabled Up Button", SftPictureImageConstants.sftImageUpDisabled, 14, 14); AddBuiltinImage("Enabled Down Button", SftPictureImageConstants.sftImageDown, 14, 14); AddBuiltinImage("Disabled Down Button", SftPictureImageConstants.sftImageDownDisabled, 14, 14); itemIndex = axSftTree1.Items.Add("Sort Direction Indicator"); axSftTree1.get_Item(itemIndex).Level = 1; AddBuiltinImage("Enabled ascending Indicator", SftPictureImageConstants.sftImageSortAsc, 8, 8); AddBuiltinImage("Disabled ascending Indicator", SftPictureImageConstants.sftImageSortAscDisabled, 8, 8); AddBuiltinImage("Enabled Descending Indicator", SftPictureImageConstants.sftImageSortDesc, 8, 8); AddBuiltinImage("Disabled Descending Indicator", SftPictureImageConstants.sftImageSortDescDisabled, 8, 8); axSftTree1.RowHeaders.MakeOptimal(); // make the row headers optimal axSftTree1.get_Column(0).MakeOptimal(); // make the first column optimal axSftTree1.Items.RecalcHorizontalExtent(); // update horizontal scroll bar axSftTree1.get_Item(0).Selected = true; axSftTree1.Items.Current = 0; CopyImageFromCurrentItem(); } private void axSftTree1_ItemClick(object sender, _DSftTreeEvents_ItemClickEvent e) { SftTreeAreaTypeConstants areaType = (SftTreeAreaTypeConstants) e.areaType; if (areaType == SftTreeAreaTypeConstants.constSftTreeExpandAll) axSftTree1.get_Item(e.itemIndex).Expand(true, true); else if (areaType == SftTreeAreaTypeConstants.constSftTreeColumn && e.colIndex == 0) SetSortDirection(!m_SortDirection); else if (areaType == SftTreeAreaTypeConstants.constSftTreeCellGraphic) ToggleImage(axSftTree1.get_Cell(e.itemIndex, e.colIndex).Image); else if (areaType == SftTreeAreaTypeConstants.constSftTreeItem) ToggleImage(axSftTree1.get_Item(e.itemIndex).Image); else if (areaType == SftTreeAreaTypeConstants.constSftTreeLabel) ToggleImage(axSftTree1.get_Item(e.itemIndex).LabelImage); } private void axSftTree1_ItemDblClick(object sender, _DSftTreeEvents_ItemDblClickEvent e) { SftTreeAreaTypeConstants areaType = (SftTreeAreaTypeConstants) e.areaType; if (areaType == SftTreeAreaTypeConstants.constSftTreeColumnRes) { axSftTree1.get_Column(e.colIndex).MakeOptimal(); // Make column width optimal axSftTree1.Items.RecalcHorizontalExtent(); // Update horizontal scroll bar } else if (areaType == SftTreeAreaTypeConstants.constSftTreeColumn && e.colIndex == 0) SetSortDirection(!m_SortDirection); else if (areaType == SftTreeAreaTypeConstants.constSftTreeCellGraphic) ToggleImage(axSftTree1.get_Cell(e.itemIndex, e.colIndex).Image); } private void axSftTree1_SelectionChange(object sender, System.EventArgs e) { CopyImageFromCurrentItem(); } private void timer1_Tick(object sender, EventArgs e) { // update all cells that have a progress bar by incrementing the progress value int items = axSftTree1.Items.Count; for (int item = 0; item < items; ++item) { ISftTreeCell cellObj = axSftTree1.get_Cell(item, 0); if (cellObj.ProgressMax > 0) cellObj.ProgressValue = (cellObj.ProgressValue + 4) % cellObj.ProgressMax; } } } }
