MultiRow Windows Forms > Developer's Guide > Using MultiRow > Cell Types > ButtonCell > Change BackColor (ButtonCell) |
You can change the backcolor of the button cell by setting any color in the ButtonCell.Style.BackColor property and then using any of the following settings:
In an environment where the visual style is enabled, the backcolor set using the ButtonCell.Style.BackColor property is not applied to the button if either the ButtonCell.FlatStyle property is set as System or the ButtonCell.UseVisualStyleBackColor property is set to True. The effect is only applied to the background of the button. The image below shows an example of a button background set by changing the ButtonCell.Style.Padding property.
This example sets style and colors for the button cell.
Imports GrapeCity.Win.MultiRow Dim template As New Template Dim buttonCell1 As New ButtonCell() buttonCell1.Name = "buttonCell1" buttonCell1.Value = "Button" buttonCell1.Style.BackColor = Color.FromArgb(255, 192, 192) buttonCell1.UseVisualStyleBackColor = False buttonCell1.FlatStyle = FlatStyle.Standard GcMultiRow1.Template = Template.CreateGridTemplate(New Cell() { buttonCell1 }) GcMultiRow1.RowCount = 10 |
using GrapeCity.Win.MultiRow; Template template = new Template(); ButtonCell buttonCell1 = new ButtonCell(); buttonCell1.Name = "buttonCell1"; buttonCell1.Value = "Button"; buttonCell1.Style.BackColor = Color.FromArgb(255, 192, 192); buttonCell1.UseVisualStyleBackColor = false; buttonCell1.FlatStyle = FlatStyle.Standard; gcMultiRow1.Template = Template.CreateGridTemplate(new Cell[] { buttonCell1 }); gcMultiRow1.RowCount = 10; |