Styled.cs
1 /*=============================================================================
2 *
3 * (C) Copyright 2011, Michael Carlisle (mike.carlisle@thecodeking.co.uk)
4 *
5 * http://www.TheCodeKing.co.uk
6 *
7 * All rights reserved.
8 * The code and information is provided "as-is" without waranty of any kind,
9 * either expresed or implied.
10 *
11 *-----------------------------------------------------------------------------
12 * History:
13 * 01/09/2007 Michael Carlisle Version 1.0
14 *=============================================================================
15 */
16 using System.Drawing;
17 using System.Windows.Forms;
18 
19 namespace sage.ew.formul.ButtonTittle.Themes
20 {
21  internal class Styled : ThemeBase
22  {
23  public Styled(Form form)
24  : base(form)
25  {
26  }
27 
28  public override Color BackColor
29  {
30  get { return Color.Transparent; }
31  }
32 
33  public override Size SystemButtonSize
34  {
35  get
36  {
37  if (base.systemButtonSize == Size.Empty)
38  {
39  if (IsToolbar)
40  {
41  Size size = base.SystemButtonSize;
42  size.Height += 2;
43  size.Width -= 1;
44  base.systemButtonSize = size;
45  }
46  else
47  {
48  Size size = SystemInformation.CaptionButtonSize;
49  size.Height -= 4;
50  size.Width -= 2;
51  base.systemButtonSize = size;
52  }
53  }
54  return base.systemButtonSize;
55  }
56  }
57 
58  public override Size FrameBorder
59  {
60  get
61  {
62  if (base.frameBorder == Size.Empty)
63  {
64  switch (form.FormBorderStyle)
65  {
66  case FormBorderStyle.SizableToolWindow:
67  case FormBorderStyle.Sizable:
68  base.frameBorder = new Size(SystemInformation.FrameBorderSize.Width + 1,
69  SystemInformation.FrameBorderSize.Height + 1);
70  break;
71  default:
72  base.frameBorder = new Size(SystemInformation.Border3DSize.Width + 2,
73  SystemInformation.Border3DSize.Height + 2);
74  break;
75  }
76  }
77  return base.frameBorder;
78  }
79  }
80  }
81 }