To add a WinForms Button to your application you need to drag a new instance of the vButton Control from the Visual Studio Toolbox and drop it into your winforms application's form. Some of the frequently used properties such as TextAlign, ImageAlign and TextImageRelation allow you to easily change the layout of the Button's Text and Image. The VIBlend Button Control comes with 25 built-in Themes. It supports the new Metro Blue, Green and Orange themes and the popular Office Themes including the themes from Microsoft Office 2003, Office 2007 and Office 2010. You can easily change the winforms button theme. What you need to do is to just set the VIBlendTheme property and the winforms button will automatically change its visual appearance. Sometimes users want to customize a theme settings such as backcolor or forecolor. In this post we will create a custom Theme using the VIBlend Controls APIs and will apply it to the WinForms Button control. - Define the theme colors. The colors array defines the default state colors, the highlightcolors array define the colors used when the mouse is over the button. The pressedcolors array defines colors used when the winforms button is pressed. C# Color[] colors = new Color[]{Color.FromArgb(255,39,94,176), Color.FromArgb(255, 37, 92, 175), Color.FromArgb(255,51,105,206), Color.FromArgb(255,53,135,226)}; Color[] highlightColors = new Color[]{Color.FromArgb(255,59,114,196), Color.FromArgb(255, 57, 112, 185), Color.FromArgb(255,71,125,226), Color.FromArgb(255,73,155,246)}; Color[] pressedColors = new Color[]{Color.FromArgb(255,79,134,216), Color.FromArgb(255, 77, 132, 215), Color.FromArgb(255,91,145,246), Color.FromArgb(255,93,175,255)}; VB .NET Dim colors() As Color = {Color.FromArgb(255,39,94,176), Color.FromArgb(255, 37, 92, 175), Color.FromArgb(255,51,105,206), Color.FromArgb(255,53,135,226)} Dim highlightColors() As Color = {Color.FromArgb(255,59,114,196), Color.FromArgb(255, 57, 112, 185), Color.FromArgb(255,71,125,226), Color.FromArgb(255,73,155,246)} Dim pressedColors() As Color = {Color.FromArgb(255,79,134,216), Color.FromArgb(255, 77, 132, 215), Color.FromArgb(255,91,145,246), Color.FromArgb(255,93,175,255)} - Define the default, highlight and pressed states. The following code illustrates how to create the styles for the winforms button states. The 90 number is for the gradient angle. This means that the button's gradient will be vertical. The 0.7f and 0.9f define the offset between each gradient color starting from 0 to 1. You can think about this as: 0f - first color, 0.7f - second color, 0.9f third color and 1.0f fourth gradient color. C# FillStyleGradientEx normalStyle = new FillStyleGradientEx(colors[0], colors[1], colors[2], colors[3], 90, 0.7f, 0.9f); FillStyleGradientEx highlightStyle = new FillStyleGradientEx(highlightColors[0], highlightColors[1], highlightColors[2], highlightColors[3], 90, 0.7f, 0.9f); FillStyleGradientEx pressedStyle = new FillStyleGradientEx(pressedColors[0], pressedColors[1], pressedColors[2], pressedColors[3], 90, 0.7f, 0.9f); Color borderColor = Color.FromArgb(31, 72, 161); VB .NET Dim normalStyle As New FillStyleGradientEx(colors(0), colors(1), colors(2), colors(3), 90, 0.7f, 0.9f) Dim highlightStyle As New FillStyleGradientEx(highlightColors(0), highlightColors(1), highlightColors(2), highlightColors(3), 90, 0.7f, 0.9f) Dim pressedStyle As New FillStyleGradientEx(pressedColors(0), pressedColors(1), pressedColors(2), pressedColors(3), 90, 0.7f, 0.9f) Dim borderColor As Color = Color.FromArgb(31, 72, 161) - Create a ControlTheme instance and initialize its StyleNormal, StyleHighlight and StylePressed properties. The FillStyle member defines the background, BorderColor defines the border's color and TextColor defines the displayed text's color. C# ControlTheme theme = ControlTheme.GetDefaultTheme(VIBLEND_THEME.OFFICEBLUE).CreateCopy(); theme.StyleNormal.FillStyle = normalStyle; theme.StyleNormal.BorderColor = borderColor; theme.StyleNormal.TextColor = Color.White; theme.StyleHighlight.FillStyle = highlightStyle; theme.StyleHighlight.BorderColor = borderColor; theme.StyleHighlight.TextColor = Color.White; theme.StylePressed.FillStyle = pressedStyle; theme.StylePressed.BorderColor = borderColor; theme.StylePressed.TextColor = Color.White; VB .NET Dim theme As ControlTheme = ControlTheme.GetDefaultTheme(VIBLEND_THEME.OFFICEBLUE).CreateCopy() theme.StyleNormal.FillStyle = normalStyle theme.StyleNormal.BorderColor = borderColor theme.StyleNormal.TextColor = Color.White theme.StyleHighlight.FillStyle = highlightStyle theme.StyleHighlight.BorderColor = borderColor theme.StyleHighlight.TextColor = Color.White theme.StylePressed.FillStyle = pressedStyle theme.StylePressed.BorderColor = borderColor theme.StylePressed.TextColor = Color.White - The final step is to set the button's Theme property to point to the ControlTheme instance. C# this.vButton1.StyleKey = "ButtonNewStyle"; this.vButton1.Theme = theme; VB .NET Me.vButton1.StyleKey = "ButtonNewStyle" Me.vButton1.Theme = theme
Currently rated 5.0 by 1 people
Tags: button, winforms button, windows forms button, .net button, button control. button theme, viblend button, viblend button control. button for winforms, .net button control, button component, professional button. metro blue button. metro green button. metro button. windows button. button for winforms, .net button control. .net4 button control, winforms controls, .net controls, viblend controls, viblend winforms controls, viblend winforms button
Buttons | VIBlend Controls for WinForms
In this post we will show you how to display the WinForms GridView in a Popup control. We will also use the new Metro Blue theme.
1. The first step is to drag and drop a new instance of the VIBlend DataGridView and the ControlBox control. The ControlBox control is a control similar to the WinForms ComboBox, but it can display any content in its Popup. 2. The next step is to initialize the Grid. We will add 5 rows and 5 columns and will populate it in unbound mode. The first column will display images in the grid cells. The rest columns will be traditional text columns. - Create the Grid Rows and Columns: C# for (int i = 0; i < 5; i++) { Grid1.RowsHierarchy.Items.Add(i.ToString()); Grid1.ColumnsHierarchy.Items.Add("Column " + i); } VB .NET For i As Integer = 0 To 4 Grid1.RowsHierarchy.Items.Add(i.ToString()) Grid1.ColumnsHierarchy.Items.Add("Column " & i) Next i Fill the first grid column with images. In order to display an image in a grid cell, you need to do two things - set the cell's display settings to DisplaySettings.ImageOnly and call the SetCellImage method passing the cell's row, column and image index parameters. C# Grid1.ImageList = imageList1; HierarchyItem columnImage = Grid1.ColumnsHierarchy.Items[0]; for (int i = 0; i < Grid1.RowsHierarchy.Items.Count; i++) { HierarchyItem rowItem = Grid1.RowsHierarchy.Items[i]; Grid1.CellsArea.SetCellDisplaySettings(rowItem, columnImage, DisplaySettings.ImageOnly); Grid1.CellsArea.SetCellImage(rowItem, columnImage, i); } VB .NET Grid1.ImageList = imageList1 Dim columnImage As HierarchyItem = Grid1.ColumnsHierarchy.Items(0) For i As Integer = 0 To Grid1.RowsHierarchy.Items.Count - 1 Dim rowItem As HierarchyItem = Grid1.RowsHierarchy.Items(i) Grid1.CellsArea.SetCellDisplaySettings(rowItem, columnImage, DisplaySettings.ImageOnly) Grid1.CellsArea.SetCellImage(rowItem, columnImage, i) Next i Fill the rest of the columns by using the SetCellValue method. C# Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[0], Grid1.ColumnsHierarchy.Items[1], "Porsche Boxster"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[1], Grid1.ColumnsHierarchy.Items[1], "Acura TL"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[2], Grid1.ColumnsHierarchy.Items[1], "Audi A4"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[3], Grid1.ColumnsHierarchy.Items[1], "BMW 645Ci"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[4], Grid1.ColumnsHierarchy.Items[1], "BMW 760Li"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[0], Grid1.ColumnsHierarchy.Items[2], true); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[1], Grid1.ColumnsHierarchy.Items[2], true); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[2], Grid1.ColumnsHierarchy.Items[2], true); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[3], Grid1.ColumnsHierarchy.Items[2], true); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[4], Grid1.ColumnsHierarchy.Items[2], true); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[0], Grid1.ColumnsHierarchy.Items[3], "4 years"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[1], Grid1.ColumnsHierarchy.Items[3], "4 years"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[2], Grid1.ColumnsHierarchy.Items[3], "4 years"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[3], Grid1.ColumnsHierarchy.Items[3], "4 years"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[4], Grid1.ColumnsHierarchy.Items[3], "4 years"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[0], Grid1.ColumnsHierarchy.Items[4], "www.porsche.com"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[1], Grid1.ColumnsHierarchy.Items[4], "www.acura.com"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[2], Grid1.ColumnsHierarchy.Items[4], "www.audi.com"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[3], Grid1.ColumnsHierarchy.Items[4], "www.bmw.com"); Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items[4], Grid1.ColumnsHierarchy.Items[4], "www.bmw.com"); VB .NET Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(0), Grid1.ColumnsHierarchy.Items(1), "Porsche Boxster") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(1), Grid1.ColumnsHierarchy.Items(1), "Acura TL") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(2), Grid1.ColumnsHierarchy.Items(1), "Audi A4") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(3), Grid1.ColumnsHierarchy.Items(1), "BMW 645Ci") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(4), Grid1.ColumnsHierarchy.Items(1), "BMW 760Li") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(0), Grid1.ColumnsHierarchy.Items(2), True) Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(1), Grid1.ColumnsHierarchy.Items(2), True) Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(2), Grid1.ColumnsHierarchy.Items(2), True) Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(3), Grid1.ColumnsHierarchy.Items(2), True) Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(4), Grid1.ColumnsHierarchy.Items(2), True) Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(0), Grid1.ColumnsHierarchy.Items(3), "4 years") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(1), Grid1.ColumnsHierarchy.Items(3), "4 years") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(2), Grid1.ColumnsHierarchy.Items(3), "4 years") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(3), Grid1.ColumnsHierarchy.Items(3), "4 years") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(4), Grid1.ColumnsHierarchy.Items(3), "4 years") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(0), Grid1.ColumnsHierarchy.Items(4), "www.porsche.com") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(1), Grid1.ColumnsHierarchy.Items(4), "www.acura.com") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(2), Grid1.ColumnsHierarchy.Items(4), "www.audi.com") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(3), Grid1.ColumnsHierarchy.Items(4), "www.bmw.com") Grid1.CellsArea.SetCellValue(Grid1.RowsHierarchy.Items(4), Grid1.ColumnsHierarchy.Items(4), "www.bmw.com") 3. In order to display the Grid in the ControlBox's Popup, you need to set the ControlBox's ContentControl property to point to the Grid instance. C# this.vControlBox.ContentControl = this.Grid1; VB .NET Me.vControlBox.ContentControl = Me.Grid1
Be the first to rate this post
Tags: winforms, winforms grid, gridview, datagridview, winforms grid, popup grid, dropdown grid, metro blue grid, grid with metro blue theme, viblend grid, viblend gridview control
DataGrid | GridView | olap grid | pivot | pivot grid | pivot, olap | VIBlend Controls for WinForms | WinForms | winforms grid
We are happy to announce the release of VIBlend WinForms Controls ver. 8.0. The new release features Metro UI themes in green, blue and red, ColorPicker DataGrid editor, DataGrid export to Excel improvements and several performance optimizations.
Tags: winforms, viblend winforms controls, windows forms controls
VIBlend Controls for WinForms | WinForms
VIBlend WinForms DataGridView has a built-in feature which allows you to set a custom Sort comparer. In this post, we will show you how to sort the DataGridView rows or columns by label. At first, we will create a Comparer which compares HierarchyItem objects by the HierarchyItem.Caption property.
C#
private class ItemLabelComparer : IComparer<HierarchyItem> { public int Compare(HierarchyItem item1, HierarchyItem item2) { return string.Compare(item1.Caption, item2.Caption); } }
VB .NET
Private Class ItemLabelComparer Implements IComparer(Of HierarchyItem) Public Function Compare(ByVal item1 As HierarchyItem, ByVal item2 As HierarchyItem) As Integer Return String.Compare(item1.Caption, item2.Caption) End Function End Class
Create an instance of the ItemLabelComparer object and pass it to the RowsHierarchy.SortBy method. If you want to sort the ColumnsHierarchy, call the ColumnsHierarchy.SortBy method. C#
ItemLabelComparer Comparer = new ItemLabelComparer(); this.vDataGridView1.RowsHierarchy.SortBy(this.vDataGridView1.ColumnsHierarchy.Items[0], sorting, Comparer); this.Refresh();
Dim Comparer As New ItemLabelComparer() Me.vDataGridView1.RowsHierarchy.SortBy(Me.vDataGridView1.ColumnsHierarchy.Items(0), sorting, Comparer) Me.Refresh()
Currently rated 3.7 by 3 people
Tags: datagrid, gridview, datagridview, viblend datagridview, winforms datagridview, winforms gridview
DataGrid | GridView | pivot | pivot grid | pivot, olap | VIBlend Controls for WinForms | WinForms | winforms grid
We are pleased to announce the availability of VIBlend Controls for WinForms ver. 7.0.
Highlights of the new features and improvements in the new version are:
To download an evaluation version, please visit our Download page.
Currently rated 3.8 by 17 people
Tags: viblend, viblend controls for windows forms, viblend winforms controls
VIBlend Controls for WinForms
We are pleased to announce the availability of the VIBlend Controls for WinForms ver. 6.0.0. the next generation of user interface controls for Windows Forms from VIBlend. This release features some important changes that you will want to check out. The release notes provide a full list of all the changes, but we wanted to point out some key features.
Improved DataGridView: The DataGridView delivers extended filtering and localization options, enhanced Pivot-Design panel, Pivot-Table Totals and new cell editors. Improved List Controls: The ComboBox and ListBox controls feature an improvement in the binding capabilities that will allow you to bind these controls to any data source. Another improvement is the enhanced styling that allows you to customize the look and feel of every list item.
Improved Styling and Appearance: In the continuous effort to make VIBlend WinForms controls meet your specific application needs, you will see improved styling features and API improvements across all controls.
Tags: winforms controls, windows forms controls, viblend controls, viblend, viblend winforms controls
The new version of VIBlend Controls for WinForms is coming in a few weeks and will deliver an upgrade to the DataGridView control with new features, better UI and styling capabilities.
- Extended filtering options
The DataGridView filtering window will be extended by providing an easier and user-friendly experience. The new filtering window will show a checked list, allowing for single and/or multiple selections. The previous filtering mechanism will still be available and you will be able to switch to it by clicking a single button. The filtering improvements will also include new case-sensitive filtering options.
- Improved support for Totals
The Pivot-Table totals support will be extended by adding a capability that will allow you to display Sub-Totals, Grand-Totals or a combination of Sub-Totals and Grand-Totals
- New Cell Editors
The new version will include several new cell editors – Currency, Percentage, Number, Mask and Fixed-Point Editors
- New Pivot-Table Filtering and enhanced Pivot-Design panel
The DataGridView will expose a new BoundFieldsFilters collection that will allow you to filter data in the Pivot-Table and display only a subset of data that meet the filtering criteria (criteria: Conditions you specify to limit which records are included in the result set of a filter.) that you specify and hides data that you do not want displayed. The Pivot-Design panel will feature a new Filter Area box that will enable you to manipulate the BoundFieldsFilters collection by drag and drop. Another addition to the Pivot-Design panel will be the Localization support.
Currently rated 5.0 by 2 people
Tags: datagridview, winforms, gridview, viblend datagrid, viblend winforms controls, windows forms datagrid
DataGrid | GridView | olap | olap grid | pivot | pivot grid | pivot, olap | VIBlend Controls for WinForms | WinForms | winforms grid
Tags: windows forms, winforms, olap, olap grid, pivot, pivot design
DataGrid | olap | olap grid | pivot grid | pivot, olap | VIBlend Controls for WinForms
VIBlend is announcing today the latest version of the VIBlend Controls for WinForms. This release features some important changes in the suite that you will want to check out.
The release notes below provide a full list of all the changes:
If you want to check out the latest release, it is now available for download.
Tags:
VIBlend Blog is powered by BlogEngine.NET