■ 컴포넌트에 커스텀 스킨을 적용하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
fpSpread1.Sheets.Count = 3; #region 인터페이스 렌더링 객체를 정의한다. FarPoint.Win.Spread.EnhancedInterfaceRenderer interfaceRenderer = new FarPoint.Win.Spread.EnhancedInterfaceRenderer(); interfaceRenderer.ArrowColorDisabled = Color.Green; interfaceRenderer.ArrowColorEnabled = Color.LightSeaGreen; interfaceRenderer.ScrollBoxBackgroundColor = Color.Aqua; interfaceRenderer.TabShape = FarPoint.Win.Spread.EnhancedInterfaceRenderer.SheetTabShape.RoundedRectangle; interfaceRenderer.TabStripButtonStyle = FarPoint.Win.Spread.EnhancedInterfaceRenderer.ButtonStyles.Enhanced; interfaceRenderer.TabStripButtonFlatStyle = FlatStyle.Popup; interfaceRenderer.SheetTabBorderColor = Color.Aquamarine; interfaceRenderer.SheetTabLowerActiveColor = Color.DarkSeaGreen; interfaceRenderer.SheetTabLowerNormalColor = Color.DarkOliveGreen; interfaceRenderer.SheetTabUpperActiveColor = Color.ForestGreen; interfaceRenderer.SheetTabUpperNormalColor = Color.LightSeaGreen; interfaceRenderer.SplitBarBackgroundColor = Color.Aquamarine; interfaceRenderer.SplitBarDarkColor = Color.DarkGreen; interfaceRenderer.SplitBarLightColor = Color.LightGreen; interfaceRenderer.SplitBoxBackgroundColor = Color.Green; interfaceRenderer.SplitBoxBorderColor = Color.LimeGreen; interfaceRenderer.TabStripBackgroundColor = Color.Aquamarine; #endregion #region 스크롤 바 렌더링 객체를 정의한다. FarPoint.Win.Spread.EnhancedScrollBarRenderer scrollBarRenderer = new FarPoint.Win.Spread.EnhancedScrollBarRenderer ( Color.Green, Color.LightGreen, Color.Green, Color.Aqua, Color.DarkGreen, Color.DarkSeaGreen, Color.Turquoise, Color.SpringGreen, Color.Teal, Color.PaleGreen, Color.ForestGreen ); #endregion #region 포커스 지시자 렌더링 객체를 정의한다. FarPoint.Win.Spread.MarqueeFocusIndicatorRenderer focusIndicatorRenderer = new FarPoint.Win.Spread.MarqueeFocusIndicatorRenderer(Color.LightSeaGreen, 2); #endregion #region 선택 렌더링 객체를 정의한다. FarPoint.Win.Spread.GradientSelectionRenderer selectionRenderer = new FarPoint.Win.Spread.GradientSelectionRenderer(); selectionRenderer.Color1 = Color.Green; selectionRenderer.Color2 = Color.LightGreen; selectionRenderer.Opacity = 50; #endregion #region 디폴트 스타일을 정의한다. FarPoint.Win.Spread.StyleInfo defaultStyleInfo = new FarPoint.Win.Spread.StyleInfo(); defaultStyleInfo.BackColor = Color.Honeydew; FarPoint.Win.Spread.NamedStyle defaultStyle = new FarPoint.Win.Spread.NamedStyle("Default", "DataAreaDefault", defaultStyleInfo); #endregion #region 컬럼 헤더 디폴트 스타일을 정의한다. FarPoint.Win.Spread.StyleInfo columnHeaderDefaultStyleInfo = new FarPoint.Win.Spread.StyleInfo(); columnHeaderDefaultStyleInfo.BackColor = Color.LightGreen; FarPoint.Win.Spread.NamedStyle columnHeaderDefaultStyle = new FarPoint.Win.Spread.NamedStyle("ColumnHeaders", "HeaderDefault", columnHeaderDefaultStyleInfo); #endregion #region 행 헤더 디폴트 스타일을 정의한다. FarPoint.Win.Spread.StyleInfo rowHeaderDefaultStyleInfo = new FarPoint.Win.Spread.StyleInfo(); rowHeaderDefaultStyleInfo.BackColor = Color.LightGreen; FarPoint.Win.Spread.NamedStyle rowHeaderDefaultStyle = new FarPoint.Win.Spread.NamedStyle("RowHeaders", "HeaderDefault", rowHeaderDefaultStyleInfo); #endregion #region 코너 디폴트 스타일을 정의한다. FarPoint.Win.Spread.StyleInfo cornerDefaultStyleInfo = new FarPoint.Win.Spread.StyleInfo(); cornerDefaultStyleInfo.BackColor = Color.LightGreen; FarPoint.Win.Spread.NamedStyle cornerDefaultStyle = new FarPoint.Win.Spread.NamedStyle("CornerHeaders", "HeaderDefault", cornerDefaultStyleInfo); #endregion FarPoint.Win.Spread.SpreadSkin spreadSkin = new FarPoint.Win.Spread.SpreadSkin ( "MySkin", interfaceRenderer, scrollBarRenderer, focusIndicatorRenderer, selectionRenderer, defaultStyle, columnHeaderDefaultStyle, rowHeaderDefaultStyle, cornerDefaultStyle ); spreadSkin.Apply(fpSpread1); |