@@ -41,7 +41,8 @@ private void CreatePens()
4141 {
4242 CreateLinePen ( ) ;
4343 CreateMarkPen ( ) ;
44- }
44+ CreateLightGrayPen ( ) ;
45+ }
4546
4647 private void CreateMarkPen ( )
4748 {
@@ -59,7 +60,14 @@ private void CreateLinePen()
5960 {
6061 _linePen = new Pen ( _lineColor ) ;
6162 _linePen . DashStyle = DashStyle . Dot ;
62- }
63+ _linePen . Width = GetScaledSize ( 1 , false ) ;
64+ }
65+
66+ private void CreateLightGrayPen ( )
67+ {
68+ _lightGrayPen = new Pen ( Color . FromArgb ( 247 , 247 , 247 ) ) ;
69+ _lightGrayPen . Width = GetScaledSize ( 1 , false ) ;
70+ }
6371
6472 protected override void OnPaint ( PaintEventArgs e )
6573 {
@@ -136,7 +144,7 @@ private void DrawRow(PaintEventArgs e, ref DrawContext context, int row, Rectang
136144 OnRowDraw ( e , node , context , row , rowRect ) ;
137145
138146 if ( ( GridLineStyle & GridLineStyle . Horizontal ) == GridLineStyle . Horizontal ) {
139- e . Graphics . DrawLine ( LightGrayPen , 0 , rowRect . Bottom , e . Graphics . ClipBounds . Right , rowRect . Bottom ) ;
147+ e . Graphics . DrawLine ( _lightGrayPen , 0 , rowRect . Bottom , e . Graphics . ClipBounds . Right , rowRect . Bottom ) ;
140148 }
141149
142150 if ( FullRowSelect )
@@ -164,8 +172,7 @@ private void DrawRow(PaintEventArgs e, ref DrawContext context, int row, Rectang
164172 DrawNode ( node , context ) ;
165173 }
166174
167- private Brush GrayBrush = new SolidBrush ( Color . FromArgb ( 240 , 240 , 240 ) ) ;
168- private Pen LightGrayPen = new Pen ( Color . FromArgb ( 247 , 247 , 247 ) ) ;
175+ private Brush GrayBrush = new SolidBrush ( Color . FromArgb ( 240 , 240 , 240 ) ) ;
169176
170177 private void DrawVerticalGridLines ( Graphics gr , int y )
171178 {
@@ -260,7 +267,8 @@ private void DrawLines(Graphics gr, TreeNodeAdv node, Rectangle rowRect)
260267 {
261268 int level = curNode . Level ;
262269 int scaledIndent = node . Tree . GetScaledSize ( _indent , false ) ;
263- int x = ( level - 1 ) * scaledIndent + NodePlusMinus . ImageSize / 2 + LeftMargin ;
270+ int x = ( level - 1 ) * scaledIndent +
271+ node . Tree . GetScaledSize ( NodePlusMinus . ImageSize , false ) / 2 + LeftMargin ;
264272 int width = node . Tree . GetScaledSize ( NodePlusMinus . Width - NodePlusMinus . ImageSize / 2 , false ) ;
265273 int y = rowRect . Y ;
266274 int y2 = y + rowRect . Height ;
0 commit comments