2008-06-14 Everaldo Canuto <ecanuto@novell.com>
authorEveraldo Canuto <everaldo@mono-cvs.ximian.com>
Mon, 16 Jun 2008 14:33:50 +0000 (14:33 -0000)
committerEveraldo Canuto <everaldo@mono-cvs.ximian.com>
Mon, 16 Jun 2008 14:33:50 +0000 (14:33 -0000)
[DataGrid drawing refactory]

* DataGrid.cs: Fix the caption size, we need one pixel more for divider.

* DataGridColumnStyle.cs: Removing PaintHeader code, the draw operations
must be handle by Theme, now it call DataGridPaintColumnHeader.

* DataGridTextBoxColumn.cs: Fix the textbox size. It must be one pixel less,
test cases must be also fixed because it checks for wrong size.

* ThemeWin32Classic.cs:
- Draw the bottom line of grid caption.
- Prevent to draw caption text when it is empty.
- Use CPDrawBorder3D for 3D efects to simplify code.
- Uses 3D (when not flat) to paint corner shared between row and column
header.
- Fix header drawing issues on win32, now borders are drawing.
- Fix column header paint issues to mimic win32.
- Adjust header drawing for last column, like first one it must be draw
different.
- Added DataGridPaintRowHeaderStar to draw star like .net does, it is
not an character.
- DataGridPaintColumnHeader created to draw column headers, it also
paint stuff right on Win32.
- Use DataGridPaintColumnHeader method instead of DataGridColumnStyle
class.

* Theme.cs:
- DataGridPaintRowHeaderStar method added.
- DataGridPaintColumnHeader method added.

svn path=/trunk/mcs/; revision=105904

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridColumnStyle.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBoxColumn.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs

index 40621a1adac40ae0e8326f021a7ac71bd7f7178c..2204190aadb67958fecafd250503017e373589ad 100644 (file)
@@ -1,3 +1,36 @@
+2008-06-14  Everaldo Canuto  <ecanuto@novell.com>
+
+       [DataGrid drawing refactory]
+
+       * DataGrid.cs: Fix the caption size, we need one pixel more for divider.
+
+       * DataGridColumnStyle.cs: Removing PaintHeader code, the draw operations
+       must be handle by Theme, now it call DataGridPaintColumnHeader.
+
+       * DataGridTextBoxColumn.cs: Fix the textbox size. It must be one pixel less,
+       test cases must be also fixed because it checks for wrong size.
+
+       * ThemeWin32Classic.cs: 
+               - Draw the bottom line of grid caption.
+               - Prevent to draw caption text when it is empty.
+               - Use CPDrawBorder3D for 3D efects to simplify code.
+               - Uses 3D (when not flat) to paint corner shared between row and column
+               header.
+               - Fix header drawing issues on win32, now borders are drawing.
+               - Fix column header paint issues to mimic win32.
+               - Adjust header drawing for last column, like first one it must be draw
+               different.
+               - Added DataGridPaintRowHeaderStar to draw star like .net does, it is
+               not an character.
+               - DataGridPaintColumnHeader created to draw column headers, it also
+               paint stuff right on Win32.
+               - Use DataGridPaintColumnHeader method instead of DataGridColumnStyle 
+               class.
+
+       * Theme.cs: 
+               - DataGridPaintRowHeaderStar method added.
+               - DataGridPaintColumnHeader method added.
+
 2008-06-13  Jonathan Pobst  <monkey@jpobst.com>
 
        * Control.cs: Don't reset to Dock style layout if DockStyle is
index 82ede8d7ba6a667cbc80e33a77fa70ad6e957e61..623ca4edffc989cfa4e1b716eb9179f0f4d96533 100644 (file)
@@ -131,7 +131,6 @@ namespace System.Windows.Forms
                internal bool is_default;
                internal DataGrid grid;
                private DataGridColumnHeaderAccessibleObject accesible_object;
-               private StringFormat string_format_hdr;
                static string def_null_text = "(null)";
                private ArrowDrawing arrow_drawing = ArrowDrawing.No;
                internal bool bound;
@@ -157,10 +156,6 @@ namespace System.Windows.Forms
                        grid = null;
                        is_default = false;
                        alignment = HorizontalAlignment.Left;
-                       string_format_hdr = new StringFormat ();
-                       string_format_hdr.FormatFlags |= StringFormatFlags.NoWrap;
-                       string_format_hdr.LineAlignment  = StringAlignment.Center;
-                       string_format_hdr.Trimming = StringTrimming.Character;
                }
 
                #endregion
@@ -529,51 +524,7 @@ namespace System.Windows.Forms
                
                internal void PaintHeader (Graphics g, Rectangle bounds, int colNum)
                {
-                       // Background
-                       g.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (DataGridTableStyle.CurrentHeaderBackColor), 
-                               bounds);
-                               
-                       if (!grid.FlatMode) {
-                               // Paint Borders
-                               g.DrawLine (ThemeEngine.Current.ResPool.GetPen (ThemeEngine.Current.ColorControlLight),
-                                       bounds.X, bounds.Y, bounds.X + bounds.Width, bounds.Y);
-                               
-                               if (colNum == 0) {
-                                       g.DrawLine (ThemeEngine.Current.ResPool.GetPen (ThemeEngine.Current.ColorControlLight),
-                                               bounds.X, bounds.Y, bounds.X, bounds.Y + bounds.Height);
-                               } else {
-                                       g.DrawLine (ThemeEngine.Current.ResPool.GetPen (ThemeEngine.Current.ColorControlLight),
-                                               bounds.X, bounds.Y + 2, bounds.X, bounds.Y + bounds.Height - 2);
-                               }
-                               
-                               g.DrawLine (ThemeEngine.Current.ResPool.GetPen (ThemeEngine.Current.ColorControlDark),
-                                       bounds.X + bounds.Width - 1, bounds.Y + 2 , bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 2);
-                       }
-                       
-                       bounds.X += 2;
-                       bounds.Width -= 2;
-
-                       if (arrow_drawing != ArrowDrawing.No)
-                               bounds.Width -= 16;
-
-                       g.DrawString (HeaderText, DataGridTableStyle.HeaderFont, ThemeEngine.Current.ResPool.GetSolidBrush (DataGridTableStyle.CurrentHeaderForeColor), 
-                               bounds, string_format_hdr);
-
-                       if (arrow_drawing != ArrowDrawing.No) {
-                               // Draw 6 x 6
-                               Point pnt = new Point (bounds.X + bounds.Width + 4, bounds.Y + ((bounds.Height - 6)/2));
-                               
-                               if (arrow_drawing == ArrowDrawing.Ascending) {
-                                       g.DrawLine (SystemPens.ControlLightLight, pnt.X + 6, pnt.Y + 6, pnt.X + 3, pnt.Y);
-                                       g.DrawLine (SystemPens.ControlDark, pnt.X, pnt.Y + 6, pnt.X + 6, pnt.Y + 6);
-                                       g.DrawLine (SystemPens.ControlDark, pnt.X, pnt.Y + 6, pnt.X + 3, pnt.Y);
-                               } else {
-                                       g.DrawLine (SystemPens.ControlLightLight, pnt.X + 6, pnt.Y, pnt.X + 3, pnt.Y + 6);
-                                       g.DrawLine (SystemPens.ControlDark, pnt.X, pnt.Y, pnt.X + 6, pnt.Y);
-                                       g.DrawLine (SystemPens.ControlDark, pnt.X, pnt.Y, pnt.X + 3, pnt.Y + 6);
-                               }
-                               
-                       }
+                       ThemeEngine.Current.DataGridPaintColumnHeader (g, bounds, grid, colNum);
                }
                
                internal void PaintNewRow (Graphics g, Rectangle bounds, Brush backBrush, Brush foreBrush)
index e0e6fd66240c6f97e42b0df345cbab738bac9ace..4c230c4e6090a3fc28b710ae476c3748d72d1b3f 100644 (file)
@@ -196,7 +196,8 @@ namespace System.Windows.Forms
 
                        textbox.ReadOnly = ro;
                        textbox.Bounds = new Rectangle (new Point (bounds.X + offset_x, bounds.Y + offset_y),
-                                                       new Size (bounds.Width - offset_x, bounds.Height - offset_y));
+                                                       new Size (bounds.Width - offset_x - 1, bounds.Height - offset_y - 1));
+
                        textbox.Visible = cellIsVisible;
                        textbox.SelectAll ();
                        textbox.Focus ();
index a5c732012a7b47987dd0ff06dc0ec0f4a7b955ba..fa41656082df5784dd16f6c92c6e50908ad64ea8 100644 (file)
@@ -777,9 +777,11 @@ namespace System.Windows.Forms
                public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
                public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
                public abstract void DataGridPaintColumnHeaders (Graphics g, Rectangle clip, DataGrid grid);
+               public abstract void DataGridPaintColumnHeader (Graphics g, Rectangle bounds, DataGrid grid, int col);
                public abstract void DataGridPaintRowContents (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
                public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
                public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
+               public abstract void DataGridPaintRowHeaderStar (Graphics g, Rectangle bounds, DataGrid grid);
                public abstract void DataGridPaintParentRows (Graphics g, Rectangle bounds, DataGrid grid);
                public abstract void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid);
                public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
index 5889b145de6b4d944e5980d920192aa1687a595e..f6987efffd18c005a8c90d61fa72dda75d59c56d 100644 (file)
@@ -1663,27 +1663,38 @@ namespace System.Windows.Forms
 
                public override void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid)
                {
-                       Rectangle modified_area = clip;
-                       modified_area.Intersect (grid.caption_area);
+                       Rectangle bounds = clip;
+                       bounds.Intersect (grid.caption_area);
 
-                       g.FillRectangle (ResPool.GetSolidBrush (grid.CaptionBackColor),
-                                        modified_area);
+                       // Background
+                       g.FillRectangle (ResPool.GetSolidBrush (grid.CaptionBackColor), bounds);
 
-                       Rectangle text_rect = grid.caption_area;
-                       text_rect.Y += text_rect.Height / 2 - grid.CaptionFont.Height / 2;
-                       text_rect.Height = grid.CaptionFont.Height;
-                       
-                       g.DrawString (grid.CaptionText, grid.CaptionFont,
-                                     ResPool.GetSolidBrush (grid.CaptionForeColor),
-                                     text_rect);
+                       // Bottom line
+               g.DrawLine (ResPool.GetPen (grid.CurrentTableStyle.CurrentHeaderForeColor),
+                                       bounds.X, bounds.Y + bounds.Height -1, 
+                    bounds.X + bounds.Width, bounds.Y + bounds.Height -1);
+
+                       // Caption text
+                       if (grid.CaptionText != String.Empty) {
+                               Rectangle text_rect = grid.caption_area;
+                               text_rect.Y += text_rect.Height / 2 - grid.CaptionFont.Height / 2;
+                               text_rect.Height = grid.CaptionFont.Height;
+
+                               g.DrawString (grid.CaptionText, grid.CaptionFont,
+                                             ResPool.GetSolidBrush (grid.CaptionForeColor),
+                                             text_rect);
+                       }
 
-                       if (modified_area.IntersectsWith (grid.back_button_rect)) {
+                       // Back button
+                       if (bounds.IntersectsWith (grid.back_button_rect)) {
                                g.DrawImage (grid.back_button_image, grid.back_button_rect);
                                if (grid.back_button_mouseover) {
                                        CPDrawBorder3D (g, grid.back_button_rect, grid.back_button_active ? Border3DStyle.Sunken : Border3DStyle.Raised, all_sides);
                                }
                        }
-                       if (modified_area.IntersectsWith (grid.parent_rows_button_rect)) {
+
+                       // Rows button
+                       if (bounds.IntersectsWith (grid.parent_rows_button_rect)) {
                                g.DrawImage (grid.parent_rows_button_image, grid.parent_rows_button_rect);
                                if (grid.parent_rows_button_mouseover) {
                                        CPDrawBorder3D (g, grid.parent_rows_button_rect, grid.parent_rows_button_active ? Border3DStyle.Sunken : Border3DStyle.Raised, all_sides);
@@ -1695,14 +1706,22 @@ namespace System.Windows.Forms
                {
                        Rectangle columns_area = grid.column_headers_area;
 
-                       if (grid.CurrentTableStyle.CurrentRowHeadersVisible) { // Paint corner shared between row and column header
+            // Paint corner shared between row and column header
+                       if (grid.CurrentTableStyle.CurrentRowHeadersVisible) {
                                Rectangle rect_bloc = grid.column_headers_area;
                                rect_bloc.Width = grid.RowHeaderWidth;
                                if (clip.IntersectsWith (rect_bloc)) {
-                                       if (grid.VisibleColumnCount > 0)
-                                               g.FillRectangle (ResPool.GetSolidBrush (grid.CurrentTableStyle.CurrentHeaderBackColor), rect_bloc);
-                                       else
+                                       if (grid.VisibleColumnCount > 0) {
+                                               if (grid.FlatMode)
+                                                       g.FillRectangle (ResPool.GetSolidBrush (grid.CurrentTableStyle.CurrentHeaderBackColor), rect_bloc);
+                                               else
+                                                       CPDrawBorder3D (g, rect_bloc, Border3DStyle.RaisedInner, 
+                                                               Border3DSide.Left | Border3DSide.Right | 
+                                                               Border3DSide.Top | Border3DSide.Bottom | Border3DSide.Middle, 
+                                                               grid.CurrentTableStyle.CurrentHeaderBackColor);
+                                       } else {
                                                g.FillRectangle (ResPool.GetSolidBrush (grid.BackgroundColor), rect_bloc);
+                                       }
                                }
 
                                columns_area.X += grid.RowHeaderWidth;
@@ -1742,7 +1761,7 @@ namespace System.Windows.Forms
                                current_clip.Intersect (prev_clip);
                                g.Clip = current_clip;
 
-                               grid.CurrentTableStyle.GridColumnStyles[column].PaintHeader (g, rect_columnhdr, column);
+                               DataGridPaintColumnHeader (g, rect_columnhdr, grid, column);
 
                                current_clip.Dispose ();
                        }
@@ -1756,6 +1775,73 @@ namespace System.Windows.Forms
                        
                }
 
+               public override void DataGridPaintColumnHeader (Graphics g, Rectangle bounds, DataGrid grid, int col)
+               {
+                       // Background
+                       g.FillRectangle (ResPool.GetSolidBrush (grid.CurrentTableStyle.HeaderBackColor), bounds);
+
+                       // Paint Borders
+                       if (!grid.FlatMode) {
+                               g.DrawLine (ResPool.GetPen (ColorControlLightLight),
+                                       bounds.X, bounds.Y, bounds.X + bounds.Width, bounds.Y);
+                               
+                               if (col == 0) {
+                                       g.DrawLine (ResPool.GetPen (ColorControlLightLight),
+                                               bounds.X, bounds.Y, bounds.X, bounds.Y + bounds.Height);
+                               } else {
+                                       g.DrawLine (ResPool.GetPen (ColorControlLightLight),
+                                               bounds.X, bounds.Y + 2, bounds.X, bounds.Y + bounds.Height - 3);
+                               }
+                               
+                               if (col == (grid.VisibleColumnCount -1)) {
+                                       g.DrawLine (ResPool.GetPen (ColorControlDark),
+                                               bounds.X + bounds.Width - 1, bounds.Y, 
+                                               bounds.X + bounds.Width - 1, bounds.Y + bounds.Height);
+                               } else {
+                                       g.DrawLine (ResPool.GetPen (ColorControlDark),
+                                               bounds.X + bounds.Width - 1, bounds.Y + 2, 
+                                               bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 3);
+                               }
+
+                               g.DrawLine (ResPool.GetPen (ColorControlDark),
+                                       bounds.X, bounds.Y + bounds.Height - 1, 
+                                       bounds.X + bounds.Width, bounds.Y + bounds.Height - 1);
+                       }
+
+                       bounds.X += 2;
+                       bounds.Width -= 2;
+
+                       DataGridColumnStyle style = grid.CurrentTableStyle.GridColumnStyles[col];
+
+                       if (style.ArrowDrawingMode != DataGridColumnStyle.ArrowDrawing.No)
+                               bounds.Width -= 16;
+
+                       // Caption
+                       StringFormat format = new StringFormat ();
+                       format.FormatFlags |= StringFormatFlags.NoWrap;
+                       format.LineAlignment = StringAlignment.Center;
+                       format.Trimming = StringTrimming.Character;
+
+                       g.DrawString (style.HeaderText, grid.CurrentTableStyle.HeaderFont, 
+                               ResPool.GetSolidBrush (grid.CurrentTableStyle.CurrentHeaderForeColor), 
+                               bounds, format);
+
+                       // Arrow (6 x 6)
+                       if (style.ArrowDrawingMode != DataGridColumnStyle.ArrowDrawing.No) {
+                               Point pnt = new Point (bounds.X + bounds.Width + 4, bounds.Y + ((bounds.Height - 6)/2));
+                               
+                               if (style.ArrowDrawingMode == DataGridColumnStyle.ArrowDrawing.Ascending) {
+                                       g.DrawLine (SystemPens.ControlLightLight, pnt.X + 6, pnt.Y + 6, pnt.X + 3, pnt.Y);
+                                       g.DrawLine (SystemPens.ControlDark, pnt.X, pnt.Y + 6, pnt.X + 6, pnt.Y + 6);
+                                       g.DrawLine (SystemPens.ControlDark, pnt.X, pnt.Y + 6, pnt.X + 3, pnt.Y);
+                               } else {
+                                       g.DrawLine (SystemPens.ControlLightLight, pnt.X + 6, pnt.Y, pnt.X + 3, pnt.Y + 6);
+                                       g.DrawLine (SystemPens.ControlDark, pnt.X, pnt.Y, pnt.X + 6, pnt.Y);
+                                       g.DrawLine (SystemPens.ControlDark, pnt.X, pnt.Y, pnt.X + 3, pnt.Y + 6);
+                               }
+                       }
+               }
+
                public override void DataGridPaintParentRows (Graphics g, Rectangle clip, DataGrid grid)
                {
                        Rectangle rect_row = new Rectangle ();
@@ -1788,8 +1874,6 @@ namespace System.Windows.Forms
 
                public override void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid)
                {
-                       //Console.WriteLine ("drawing parent row {0}", row);
-
                        // Background
                        g.FillRectangle (ResPool.GetSolidBrush (grid.ParentRowsBackColor),
                                         bounds);
@@ -1811,8 +1895,6 @@ namespace System.Windows.Forms
                        text_size = g.MeasureString (table_name, bold_font).ToSize();
                        text_rect = new Rectangle(new Point(bounds.X + 3, bounds.Y + bounds.Height - text_size.Height), text_size);
 
-                       //Console.WriteLine ("drawing text at {0}", text_rect);
-
                        g.DrawString (table_name,
                                      bold_font, ResPool.GetSolidBrush (grid.ParentRowsForeColor), text_rect, text_format);
 
@@ -1829,26 +1911,15 @@ namespace System.Windows.Forms
                                text_rect.Size = g.MeasureString (text, grid.Font).ToSize();
                                text_rect.Y = bounds.Y + bounds.Height - text_rect.Height; // XXX
 
-                               //Console.WriteLine ("drawing text at {0}", text_rect);
-
                                g.DrawString (text,
                                              grid.Font, ResPool.GetSolidBrush (grid.ParentRowsForeColor), text_rect, text_format);
                        }
 
-                       if (grid.FlatMode == false) {
-                               
-                               // Paint Borders
-                               g.DrawLine (ResPool.GetPen (ColorControlLight),
-                                       bounds.X, bounds.Y, bounds.X + bounds.Width, bounds.Y);
-       
-                               g.DrawLine (ResPool.GetPen (ColorControlLight),
-                                       bounds.X, bounds.Y + 1, bounds.X, bounds.Y + bounds.Height - 1);
-       
-                               g.DrawLine (ResPool.GetPen (ColorControlDark),
-                                       bounds.X + bounds.Width - 1, bounds.Y + 1 , bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1);
-       
-                               g.DrawLine (ResPool.GetPen (ColorControlDark),
-                                       bounds.X, bounds.Y + bounds.Height -1, bounds.X + bounds.Width, bounds.Y  + bounds.Height -1);
+            // Paint Borders
+                       if (!grid.FlatMode) {
+                CPDrawBorder3D (g, bounds, Border3DStyle.RaisedInner, 
+                    Border3DSide.Left | Border3DSide.Right | 
+                    Border3DSide.Top | Border3DSide.Bottom);
                        }
                }
 
@@ -1878,14 +1949,25 @@ namespace System.Windows.Forms
                                (grid.CurrentTableStyle.CurrentHeaderForeColor), arrow, FillMode.Winding);
                }
 
+               public override void DataGridPaintRowHeaderStar (Graphics g, Rectangle bounds, DataGrid grid) 
+               {
+                       int x = bounds.X + 4;
+                       int y = bounds.Y + 3;
+                       Pen pen = ResPool.GetPen (grid.CurrentTableStyle.CurrentHeaderForeColor);
+
+                       g.DrawLine (pen, x + 4, y, x + 4, y + 8);
+                       g.DrawLine (pen, x, y + 4, x + 8, y + 4);
+                       g.DrawLine (pen, x + 1, y + 1, x + 7, y + 7);
+                       g.DrawLine (pen, x + 7, y + 1, x + 1, y + 7);
+               }               
+
                public override void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid)
                {
                        bool is_add_row = grid.ShowEditRow && row == grid.DataGridRows.Length - 1;
                        bool is_current_row = row == grid.CurrentCell.RowNumber;
 
                        // Background
-                       g.FillRectangle (ResPool.GetSolidBrush (grid.CurrentTableStyle.CurrentHeaderBackColor),
-                                        bounds);
+                       g.FillRectangle (ResPool.GetSolidBrush (grid.CurrentTableStyle.CurrentHeaderBackColor), bounds);
 
                        // Draw arrow
                        if (is_current_row) {
@@ -1899,23 +1981,13 @@ namespace System.Windows.Forms
                                }
                        }
                        else if (is_add_row) {
-                               g.DrawString ("*", grid.Font, ResPool.GetSolidBrush (grid.CurrentTableStyle.CurrentHeaderForeColor),
-                                             bounds);
+                               DataGridPaintRowHeaderStar (g, bounds, grid);
                        }
 
-                       if (grid.FlatMode == false && !is_add_row) {
-                               // Paint Borders
-                               g.DrawLine (ResPool.GetPen (ColorControlLight),
-                                           bounds.X, bounds.Y, bounds.X + bounds.Width, bounds.Y);
-
-                               g.DrawLine (ResPool.GetPen (ColorControlLight),
-                                           bounds.X, bounds.Y + 1, bounds.X, bounds.Y + bounds.Height - 1);
-
-                               g.DrawLine (ResPool.GetPen (ColorControlDark),
-                                           bounds.X + bounds.Width - 1, bounds.Y + 1 , bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1);
-
-                               g.DrawLine (ResPool.GetPen (ColorControlDark),
-                                           bounds.X, bounds.Y + bounds.Height -1, bounds.X + bounds.Width, bounds.Y  + bounds.Height -1);
+                       if (!grid.FlatMode && !is_add_row) {
+                               CPDrawBorder3D (g, bounds, Border3DStyle.RaisedInner, 
+                                       Border3DSide.Left | Border3DSide.Right | 
+                                       Border3DSide.Top | Border3DSide.Bottom);
                        }
                }