Archive for the DotNetBar for Windows Forms Category

You can use following code to enumerate through all nodes in DotNetBar for WinForms AdvTree control: C#: // Following code enumerates through all nodes and prints out node text to console foreach (Node node in AllNodes(advTree1.Nodes)) { Console.WriteLine(node.Text); } // This is what makes flat access to tree nodes easy private static IEnumerable AllNodes(NodeCollection […]

DotNetBar ButtonItem include built-in symbol library. At design-time symbols are set using visual editor provided for Symbol property which makes choice of symbol easy. From code however, you need to use symbol unicode. That code would look like this: C#: button.Symbol = "\uf060"; VB: button.Symbol = ChrW("&Hf060") Since we included 2 symbol set libraries, you […]

The RibbonControl by default has fixed height and its height needs to be adjusted manually if for example DPI settings on target machine change or usage of larger fonts is expected on target machines. Ribbon Control does not manage the height automatically since it does not have knowledge about the full ribbon height. There might […]

InitializeComponent() method in Visual Studio.NET C# or VB.NET is method that is automatically created and managed by Windows Forms designer and it defines everything you see on the form. Everything done on the form in VS.NET using designers generates code. Every single control added and property set will generate code and that code goes into […]

To programatically change the widths of the AdvPropertyGrid columns in DotNetBar for WinForms use SetPropertyColumnWidth method. For example to set width of the property name column to 100 pixels you can use following code: advPropertyGrid1.SetPropertyColumnWidth(0, 100)

Follow these steps to create Ribbon Tab Groups: Add RibbonControl to the form. Select the RibbonTabItem2 that is created by default. In VS.NET Property window find Group property and select it Click the drop-down button for Group property and choose Create New Group Select RibbonControl and in Property VS.NET window ensure that TabGroupsVisible property is […]

DotNetBar for Windows Forms ItemPanel control starting with 10.1.0.6 release includes support for data-binding. To bind ItemPanel to your data source follow these steps: Set DataSource property to the source of your data. This can be array of custom objects or data set. Set ItemTemplate property to the item which will act as template for […]

You can render row numbers for DataGridView and DataGridViewX by handling RowPostPaint event. Then you use following code: C#: void DataGridViewRowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { DataGridView dg = (DataGridView)sender; // Current row record string rowNumber = (e.RowIndex + 1).ToString(); // Format row based on number of records displayed by using leading zeros while (rowNumber.Length […]

DotNetBar for Windows Forms includes set of Metro controls to help you develop great looking Metro look and feel user interface for your apps. Usually Metro applications will use at least: 1. MetroAppForm – which is chrome-less Metro style form: 2. MetroShell – which provides basic window chrome, backstage and top-level application tabs: 3. MetroStatusBar […]

DotNetBar for Windows Forms Advanced PropertyGrid control provides complete support for ICustomTypeDescriptor interface that you can use to provide completely virtual properties that are shown and edited in property grid. This involves implementing ICustomTypeDescriptor interface on your object and the at least providing list of custom properties returned from GetProperties(Attribute[] attributes) method that you implement […]