void setFreezeStyleButton_Click(object sender, EventArgs e) { FreezeLines freezeLines = this.gcMultiRow1.FreezeLines; if (this.gcMultiRow1.FreezeLines.All == new Line(LineStyle.Thin, Color.Black)) { // set top freeze line to a thin red line. freezeLines.Top = new Line(LineStyle.Thin, Color.Red); // set top freeze line to a thin red line. freezeLines.Bottom = new Line(LineStyle.MediumDashed, Color.Green); // set top freeze line to a thin red line. freezeLines.Right = new Line(LineStyle.Double, Color.Blue); // hide left freeze line, but freeze behavior still take effect. freezeLines.Left = Line.Empty; } else { freezeLines.All = new Line(LineStyle.Thin, Color.Black); } this.gcMultiRow1.FreezeLines = freezeLines; }
Private Sub setFreezeStyleButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setFreezeStyleButton.Click Dim freezeLines As FreezeLines = Me.gcMultiRow1.FreezeLines If Me.gcMultiRow1.FreezeLines.All = New Line(LineStyle.Thin, Color.Black) Then ' set top freeze line to a thin red line. freezeLines.Top = New Line(LineStyle.Thin, Color.Red) ' set top freeze line to a thin red line. freezeLines.Bottom = New Line(LineStyle.MediumDashed, Color.Green) ' set top freeze line to a thin red line. freezeLines.Right = New Line(LineStyle.Double, Color.Blue) ' hide left freeze line, but freeze behavior still take effect. freezeLines.Left = Line.Empty Else freezeLines.All = New Line(LineStyle.Thin, Color.Black) End If Me.gcMultiRow1.FreezeLines = freezeLines End Sub