MultiRow Windows Forms > Developer's Guide > Using MultiRow > Cell Styles > Mouse Hover Styles |
You can set the style for the mouse hover in the cell style. The mouse hover style can set the backcolor, the background gradation, and the forecolor.
You can set the backcolor and forecolor of the mouse hover style, using the CellStyle.MouseOverBackColor property, and the CellStyle.MouseOverForeColor property.
This example sets the MouseOverBackColor and MouseOverForeColor properties.
GcMultiRow1.Rows(0).Cells(0).Style.MouseOverBackColor = Color.Yellow GcMultiRow1.Rows(0).Cells(0).Style.MouseOverForeColor = Color.Red |
gcMultiRow1.Rows[0].Cells[0].Style.MouseOverBackColor = Color.Yellow; gcMultiRow1.Rows[0].Cells[0].Style.MouseOverForeColor = Color.Red; |
You can can use the CellStyle.MouseOverGradientEffect property to set gradation in the background color of the mouse hover.
This example sets the gradation.
Dim gradientEffect1 As New GradientEffect() gradientEffect1.Colors = New Color() {Color.Green, Color.Yellow} gradientEffect1.Style = GradientStyle.Horizontal gradientEffect1.Direction = GradientDirection.Side GcMultiRow1.Rows(0).Cells(0).Style.MouseOverGradientEffect = gradientEffect1 |
GradientEffect gradientEffect1 = new GradientEffect(); gradientEffect1.Colors = new Color[] {Color.Green, Color.Yellow}; gradientEffect1.Style = GradientStyle.Horizontal; gradientEffect1.Direction = GradientDirection.Side; gcMultiRow1.Rows[0].Cells[0].Style.MouseOverGradientEffect = gradientEffect1; |
You can set the backcolor and background gradation of the mouse hover style for individual sections.
This example sets the gradation.
Dim gradientEffect1 As New GradientEffect() gradientEffect1.Colors = New Color() {Color.Green, Color.Yellow} gradientEffect1.Style = GradientStyle.Horizontal gradientEffect1.Direction = GradientDirection.Side GcMultiRow1.Rows(0).MouseOverGradientEffect = gradientEffect1 GcMultiRow1.Rows(1).MouseOverBackColor = Color.Azure |
GradientEffect gradientEffect1 = new GradientEffect(); gradientEffect1.Colors = new Color[] {Color.Green, Color.Yellow}; gradientEffect1.Style = GradientStyle.Horizontal; gradientEffect1.Direction = GradientDirection.Side; gcMultiRow1.Rows[0].MouseOverGradientEffect = gradientEffect1; gcMultiRow1.Rows[1].MouseOverBackColor = Color.Azure; |