I am making a project on Visual Studio 2010 and i want to add some Stylish and Glassy Buttons to it so plz how can i do this ? if i could get some already made Buttons or i can make them myself ..............

Thnks :)

Dani AI

Generated

Two practical routes depending on your project: use WPF for the easiest, highest-quality “glassy” buttons; or stay in WinForms and either supply PNG assets or create an owner-drawn control. Building on (images) and (WPF/Expression Blend), below are compact, ready approaches you can drop into a Visual Studio 2010 / .NET 4.0 project plus a few gotchas. ’s point about commercial suites is valid if you want a plug‑and‑play skin.

WPF (recommended for new UI)

  • Define a simple ControlTemplate with a gradient + a semi‑transparent white overlay for the gloss.
  • Example XAML style (place in Window.Resources or a ResourceDictionary):
<Style x:Key="GlassButton" TargetType="Button">
  <Setter Property="Background">
    <Setter.Value>
      <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFBFEFFF" Offset="0"/>
        <GradientStop Color="#FF68B7E6" Offset="1"/>
      </LinearGradientBrush>
    </Setter.Value>
  </Setter>
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="Button">
        <Border x:Name="border" Background="{TemplateBinding Background}" CornerRadius="6" BorderBrush="#66000000" BorderThickness="1" Padding="6">
          <Grid>
            <Rectangle Fill="#60FFFFFF" Height="10" VerticalAlignment="Top" RadiusX="6" RadiusY="6" Margin="4,4,4,0"/>
            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
          </Grid>
        </Border>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

WinForms (if you must stay WinForms)

  • Either use a PNG with alpha as BackgroundImage (set FlatStyle=Flat, BorderSize=0) or create an owner-drawn Button for scalable, DPI-friendly results.
  • Minimal custom button (override OnPaint, use GraphicsPath for rounded corners and LinearGradientBrush for the glass effect):
// requires System.Drawing.Drawing2D
public class GlassButton : Button {
  public GlassButton() {
    SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint |
             ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
    FlatStyle = FlatStyle.Flat; FlatAppearance.BorderSize = 0; BackColor = Color.Transparent;
  }
  protected override void OnPaint(PaintEventArgs e) {
    var g = e.Graphics; g.SmoothingMode = SmoothingMode.AntiAlias;
    var r = ClientRectangle; r.Inflate(-1,-1);
    using(var p = RoundedRect(r,8))
    using(var b = new LinearGradientBrush(r, Color.FromArgb(220,240,248), Color.FromArgb(150,200,230),90f)) {
      g.FillPath(b,p);
      using(var hl = new LinearGradientBrush(new Rectangle(r.X,r.Y,r.Width,r.Height/2), Color.FromArgb(180,255,255,255), Color.FromArgb(0,255,255,255),90f))
        g.FillPath(hl,p);
      g.DrawPath(new Pen(Color.FromArgb(120,255,255,255)), p);
      TextRenderer.DrawText(g, Text, Font, r, ForeColor, TextFormatFlags.HorizontalCenter|TextFormatFlags.VerticalCenter);
    }
  }
  GraphicsPath RoundedRect(Rectangle r,int radius) { var path=new GraphicsPath(); int d=radius*2; path.AddArc(r.X,r.Y,d,d,180,90); path.AddArc(r.Right-d,r.Y,d,d,270,90); path.AddArc(r.Right-d,r.Bottom-d,d,d,0,90); path.AddArc(r.X,r.Bottom-d,d,d,90,90); path.CloseFigure(); return path; }
}

Quick tips and cautions

  • WinForms: transparent backgrounds and per-pixel alpha can be tricky; use ControlStyles and double buffering to avoid flicker. Test with different DPI and Windows themes.
  • Accessibility: maintain keyboard focus visuals and contrast; glassy gloss must not reduce legibility.
  • If you want ready-made polished skins, commercial suites (DevExpress/Telerik/etc.) save time but cost money, as noted.

Recommended Answers

All 3 Replies

If you are talking about Windows Forms then the button control has an Image property, you can set that to any image you have residing on your computer. Flashy buttons can be created in Photoshop (costs for a copy) or the the Gimp (free). You can find plenty of free icon sets online, just type free icon sets into Google. Or you can create your own using the many photshop tutorials you find online.

For a user rich application environment create a WPF project. You can use Expression Blend for designing.

If you have a deep wallet, DevExpress has some outstanding control suites that I use quite regularly at work. If you don't want to spend any money, you will either have to write them yourself or find a really nice person who has done your work for you. Let us know what route you want to take - designing your own custom user controls or getting pre-made ones.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.