Spread Windows Forms 11.0 Product Documentation
ResetSections Method
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.DrawingSpace Namespace > PSGradient Class : ResetSections Method
Resets the gradient sections of the object.
Syntax
'Declaration
 
Public Overridable Sub ResetSections() 
'Usage
 
Dim instance As PSGradient
 
instance.ResetSections()
public virtual void ResetSections()
Example
FarPoint.Win.Spread.DrawingSpace.PSGradient g = new FarPoint.Win.Spread.DrawingSpace.PSGradient();
g.Name = "custom";
g.Style = FarPoint.Win.Spread.DrawingSpace.GradientStyle.RadialIntoCenter;
g.Sections[0].Color = Color.Navy;
g.Sections[0].AlphaBlend = 128;
g.Sections[1].Color = Color.Magenta;
g.Sections[1].AlphaBlend = 255;

FarPoint.Win.Spread.DrawingSpace.ArrowShape arrow = new FarPoint.Win.Spread.DrawingSpace.ArrowShape(fpSpread1);
arrow.CanSize = FarPoint.Win.Spread.DrawingSpace.Sizing.HeightAndWidth;
arrow.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical;
arrow.Anchor = 20;
arrow.SetBounds(15, 15, 50, 50);
arrow.Gradient = g;
fpSpread1.ActiveSheet.AddShape(arrow);

DialogResult dlg;
dlg = MessageBox.Show("Do you want to reset the gradient sections??", "ResetGradient", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
    g.ResetSections()
}
Dim g As New FarPoint.Win.Spread.DrawingSpace.PSGradient
g.Name = "custom"
g.Style = FarPoint.Win.Spread.DrawingSpace.GradientStyle.RadialIntoCenter
g.Sections(0).Color = Color.Navy
g.Sections(0).AlphaBlend = 128
g.Sections(1).Color = Color.Magenta
g.Sections(1).AlphaBlend = 255

Dim arrow As New FarPoint.Win.Spread.DrawingSpace.ArrowShape(FpSpread1)
arrow.CanSize = FarPoint.Win.Spread.DrawingSpace.Sizing.HeightAndWidth
arrow.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical
arrow.Anchor = 20
arrow.SetBounds(15, 15, 50, 50)
arrow.Gradient = g
FpSpread1.ActiveSheet.AddShape(arrow)

Dim dlg As DialogResult
dlg = MessageBox.Show("Do you want to reset the gradient sections??", "ResetGradient", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
    g.ResetSections()
End If
See Also

Reference

PSGradient Class
PSGradient Members