|
31 | 31 | using Com.Couchcoding.GuiLibrary.Helper; |
32 | 32 | using System.ComponentModel; |
33 | 33 | using System.Drawing; |
| 34 | +using System.Drawing.Drawing2D; |
34 | 35 | using System.Windows.Forms; |
35 | 36 |
|
36 | 37 | namespace Com.Couchcoding.GuiLibrary.Dialogs |
@@ -351,24 +352,28 @@ protected virtual void DrawDialogBackground(Graphics grfx) |
351 | 352 | { |
352 | 353 | grfx.FillRectangle(headerBrush, new Rectangle( |
353 | 354 | 0 |
354 | | - , 0 |
355 | | - , ClientRectangle.Width |
356 | | - , headerHeight)); |
| 355 | + , 0 |
| 356 | + , ClientRectangle.Width |
| 357 | + , headerHeight)); |
357 | 358 | } |
358 | 359 |
|
359 | | - ControlPaint.DrawVisualStyleBorder( |
360 | | - grfx |
361 | | - , new Rectangle( |
362 | | - -SystemInformation.BorderSize.Width |
363 | | - , -SystemInformation.BorderSize.Height |
364 | | - , ClientRectangle.Width + SystemInformation.BorderSize.Width + SystemInformation.BorderSize.Width |
365 | | - , headerHeight - 1)); |
| 360 | + Rectangle shadowRect = new Rectangle(0, headerHeight - 2, Width, 2); |
| 361 | + |
| 362 | + if (shadowRect.Width > 0 && shadowRect.Height > 0) |
| 363 | + { |
| 364 | + using (LinearGradientBrush shadowBrush = new LinearGradientBrush(shadowRect, SystemColors.ControlDark, ContentColor, LinearGradientMode.Vertical)) |
| 365 | + { |
| 366 | + // Set the wrap mode to tile flip x to fix flickering on resize. |
| 367 | + shadowBrush.WrapMode = WrapMode.TileFlipX; |
| 368 | + |
| 369 | + grfx.FillRectangle(shadowBrush, shadowRect); |
| 370 | + } |
| 371 | + } |
366 | 372 | } |
367 | 373 |
|
368 | 374 | if (mDialogImage != null) |
369 | 375 | { |
370 | | - grfx.DrawImage( |
371 | | - mDialogImage |
| 376 | + grfx.DrawImage(mDialogImage |
372 | 377 | , new Rectangle( |
373 | 378 | ClientRectangle.Width - mDialogImage.Width |
374 | 379 | , (headerHeight - mDialogImage.Height) >> 1 |
|
0 commit comments