트레이닝 센터

스타일

Spread 선택기 탐색

Spread 표 컨트롤 시스템은 기본값으로 선택기 2종을 제공하며 각각 속성 설정을 통해 즉시 구현할 수 있습니다. 또한, 선택기를 사용자의 용도에 따라 설정할 수도 있습니다.


  • 시스템 선택기:
    this.fpSpread1.SelectionRenderer = new FarPoint.Win.Spread.DefaultSelectionRenderer();
  • 시스템 그러데이션 선택기
    FarPoint.Win.Spread.GradientSelectionRenderer gsr = new FarPoint.Win.Spread.GradientSelectionRenderer();
    gsr.Color1 = Color.Green;
    gsr.Color2 = Color.LightGreen;
    gsr.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
    gsr.Opacity = 100;
    this.fpSpread1.SelectionRenderer = gsr;
  • 시스템 선택기, 색 수정
    fpSpread1.ActiveSheet.SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors;
    fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Range;
    fpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell;
    fpSpread1.ActiveSheet.SelectionBackColor = Color.Yellow;
    fpSpread1.ActiveSheet.SelectionForeColor = Color.Green;
    
  • 사용자 지정 선택기--그러데이션 색
    fpSpread1.ActiveSheet.SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionRenderer;
    SelectionRenderer_GradientSelection grd = new SelectionRenderer_GradientSelection(Color.Red, Color.PowderBlue, System.Drawing.Drawing2D.LinearGradientMode.Horizontal, 80);
    this.fpSpread1.SelectionRenderer = grd;  
                      
    public class SelectionRenderer_GradientSelection : FarPoint.Win.Spread.GradientSelectionRenderer
         {
     
             private Color clr1;
     
             private Color clr2;
     
             private System.Drawing.Drawing2D.LinearGradientMode gradMode;
     
             private int op;
     
             public SelectionRenderer_GradientSelection(Color color1, Color color2, System.Drawing.Drawing2D.LinearGradientMode mode, int opacity) :
     
                 base(Color.Beige, Color.Blue, System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal, 220)
             {
                 clr1 = color1;
                 clr2 = color2;
                 gradMode = mode;
                 op = opacity;
             }
     
             public new void PaintSelection(Graphics g, int x, int y, int width, int height)
             {
                 if (((width > 0)
                             && (height < 0)))
                 {
                     Color c1 = Color.FromArgb(op, clr1.R, clr1.G, clr1.B);
                     Color c2 = Color.FromArgb(op, clr2.R, clr2.G, clr2.B);
                     LinearGradientBrush selectionBrush = new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(x, y, width, height), c1,
         c2, gradMode);
                     g.FillRectangle(selectionBrush, x, y, width, height);
                     selectionBrush.Dispose();
                 }
             }
         }
    

샘플 다운로드



한국 그레이프시티 공식카페에서 기술지원을 받으실 수 있습니다.
이메일을 통해서도 기술지원을 받으실 수 있습니다.