Open Source Dotnet

Vista Style Button in C#


Screenshot - Screenshot.jpg

Introduction

I have a habit of using the standard Windows controls as little as possible. If I can write my own control to do it then I will. It's kinda like reinventing the wheel but adding spinners. Anyways this is an article on a Vista Style button that I made. Unlike the progress bar control I wrote, I didn't create it in Photoshop first. I just designed it in code, as a result it's not quite as nice looking as the actual Vista buttons. The actual button itself can be made very un-Vista-ish if you want to by changing the colours but the default look for the button is the one in the top left.

Coppy Right : http://www.codeproject.com/KB/buttons/VistaButton.aspx


->Read More...

XP-Style Button

Sample Image - XP-Style_Button.jpg

Introduction

XP-Style Button provides the look and feel of a button with any of of the three built-in color schemes of Windows XP and will also work with earlier versions of Windows, or using a color scheme if you use Windows XP. You simply don't have to worry about how the button will look like on different versions of Windows - it will always look the same.

->Read More...

Custom Bitmap Button Using C#


Sample Image - maximum width is 600 pixels

Introduction

The motivation behind the custom bitmap control was to allow different bitmap images to be displayed for each of the button states. This includes disabled, normal, mouse over, and button pressed. In addition to the button graphics, it was important to include button text and control the alignment of the text with regards to the button image. It follows an XP style look and feel with some embellishments that are unique to it.

CopyRight :http://www.codeproject.com/KB/buttons/XCtrls.aspx

->Read More...

WindowsVistaRenderer: A New Button Generation


Screenshot - VistaRenderer.jpg

Introduction

This article demonstrates how to use the WindowsVistaRenderer and how it was created.

LedButton Status Control

Sample Image->Read More...

HyperButtonEx: An All-in-One Button Class

Screenshots

Introduction

This class introduces HyperButtonEx, an all-in-one button class. It supports bitmap transparency, custom fonts, rounded rectangles, and more! Hyperlink and Shell functionality has been built into the class.

->Read More...

FxButton Class


Second demo button gallery

Introduction

FxButton allows developers to create customized buttons using captions, bitmaps, tooltips, etc. It cannot do everything, so be sure to check its limitations. I'm a beginner in coding VC++ with MFC and I made this class for fun and - above all - to learn.

The aim of this class - but not the only one - is to make it as easy as possible to integrate it in an application and to have the maximum options available. If you don't know what a handle is and you want a bitmap button, you can use this class.

The first FxButton demo is not a button gallery; it contains only one FxButton but you can play with it. The demo gives access to about 30 button components. Each of these options can be applied to any button state: normal, pushed, over or disabled.

The second FxButton demo is a button gallery. It shows the use of clipping regions for buttons and transparent bitmaps applied to push, check or radio buttons.

Copy Right : http://www.codeproject.com/KB/buttons/fxbutton.aspx

->Read More...

RoundButton Windows Control - Ever Decreasing Circles

Round buttons

Introduction

Some time ago, I tried to find a nice round-button control. I couldn't find one, so in the time-honoured tradition, I decided to write my own. I "almost" finished it, but for various reasons, it was consigned to the "come back to it later" category. In its inimitable style, "later" finally arrived, and armed with my shiny new Microsoft Visual C# 2005 Express Edition, I decided to have a crack at finishing it.

Though I say it myself, I think the buttons look nice - you'll have to judge for yourself! They look even better "in the flesh", rather than as the JPEGs in this article.

Background

In my quest for a round button control, I came across a couple of articles (including one by the great man Chris Maunder himself!) which seemed to me and my Very Small Brain to have far too much complicated mathematics involved. Also, I'd been learning about graphics in C#, and doing a lot of experimenting with groovy things like the PathGradientBrush, taking much inspiration from the very excellent Bob Powellsite. Probably, by chance, I forget exactly how, I stumbled upon the idea of layering ever decreasing circles filled withLinearGradientBrushes and PathGradientBrushes one above the other to build up a passable 3-D button. The following images illustrate this:

Hover your cursor for a description

The Button recess onlyThe Button recess with an edgeThe Button recess with an edge and an outer bevel

The Button recess with an edge and both bevelsThe Button recess with an edge, both bevels and a flat topThe Button recess with an edge, both bevels and a domed top

Copy Right http://www.codeproject.com/KB/buttons/RoundButton.aspx

->Read More...

Vista Style Button in C#


Screenshot - Screenshot.jpg

Introduction

I have a habit of using the standard Windows controls as little as possible. If I can write my own control to do it then I will. It's kinda like reinventing the wheel but adding spinners. Anyways this is an article on a Vista Style button that I made. Unlike the progress bar control I wrote, I didn't create it in Photoshop first. I just designed it in code, as a result it's not quite as nice looking as the actual Vista buttons. The actual button itself can be made very un-Vista-ish if you want to by changing the colours but the default look for the button is the one in the top left.

Coppy Right : http://www.codeproject.com/KB/buttons/VistaButton.aspx

->Read More...

SplitButton: an XP style dropdown split button

Demo

Demo

Introduction

Yesterday, I was thinking the best way to solve a particular situation (specific actions derived logically from one) was a split button. Searching and searching on MSDN produced no results, so I was perplexed: no split button in .NET? No, there isn't. The strange thing is that aStripSplitButton (or something like that) exists, that is, the split button equivalent for the ToolStrip. Probably, not being a standard control for the system, they though not to include the control, because it was easy to simulate its functionality with images, and that's what I did.

Using the code

The control is very easy to use. Anyway, this is the step-by-step how-to-do:

  1. Include SplitButton.cs and SplitButton.designer.cs in your project.
  2. Load the assembly in the toolbox of Visual Studio, or just insert a Button control in your form, and then change the type from Buttonto SplitButton.

    [Updated: Oct '06] You can stop here, default images for split states will be used by the control, or you can follow next steps to customize split images.

    Optional:

  3. Add an ImageList to your form (or control or whatever) and set the ImageList property of the SplitButton to this ImageList.
  4. Add images you want to the ImageList for the SplitButton splitter side statuses: Normal, Hover, Clicked, Disabled,Focused.
  5. Now, have a look at the property windows for the SplitButton, go to "Split Button Images" category, and simply select an image for each status from the list box of images (the ones in the ImageList of the SplitButton).
  6. Now, you can set some suggested options: TextAlign to MiddleLeft, ImageAlign to MiddleRight, and TextImageRelationto TextBeforeImage. You're done.

Now you can set some custom options for the SplitButton, a brief description follows:

  • bool DoubleClickedEnabled - Indicates whether the double click event is raised on the SplitButton.
  • bool AlwaysDropDown - Indicates whether the SplitButton always shows the drop down menu even if the button part is clicked.
  • bool AlwaysHoverChange - Indicates whether the SplitButton always shows the hover image status in the split part even if the button part is hovered.
  • bool CalculateSplitRect - Indicates whether the split rectangle must be calculated (based on the split image size).
  • bool FillSplitHeight - Indicates whether the split height must be filled to the button height even if the split image height is lower.
  • int SplitHeight - The split height (ignored if CalculateSplitRect is set to true).
  • int SplitWidth - The split width (ignored if CalculateSplitRect is set to true).

In addition to this, there are two events:

  • ButtonClick - Occurs when the button part of the SplitButton is clicked.
  • ButtonDoubleClick - Occurs when the button part of the SplitButton is double-clicked.

Conclusion

It's only a simple control, I know, but it could be useful in my opinion.

So, that's all, I think. I hope you'll find it useful, bye!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

->Read More...

Bouncing Hover Button


Sample Image

Introduction

This multifunctional button supports two different styles: Standard (standard VB.NET button) and BouncingHover. In theBouncingHover mode, the user can set normal and hover colors for the button's border, backcolor and forecolor as well as location of the text and the image. In this mode, the button's image (if it exists) and text are bouncing when the mouse is entering/leaving or clicking the control, while the disabled button's image and text get a colorless view. This control also supports three different types: Normal, Check andAlternative, that make the button work respectively as a normal Button, CheckBox and RadioButton. The user can also switch on beep and manage its duration and frequency.

Copyright :http://www.codeproject.com/KB/cpp/BouncingHoverButton.aspx

->Read More...

XP Button Style in VB.NET

Download :

Introduction

I was surprised to find that Visual Studio 2003 .NET, the latest and greatest Windows application development tool, doesn't include an easy way to create XP-style buttons. Then I noticed that Office XP mostly uses the old-fashioned 3D buttons, suggesting that implementing the new style is not trivial. The new buttons are mostly found in Windows XP accessories and Internet Explorer 6. As a programmer, my first reaction was to jump in and reinvent the wheel, which reminds me that I need to start waiting for my second reaction before I waste any more time.

This article describes a way to create XP-like buttons by implementing the button's Paint method. It's an (interesting, I hope) exploration of GDI+ graphics. But you don't have to go to all this trouble, nor do you have to accept less than perfect results, to achieve XP buttons. You simply need to link your Windows Form application with the latest version (6.0) of ComCtl32.

Copyright:http://www.codeproject.com/KB/cpp/XPStyleB.aspx

->Read More...

Office 2007 Button

Introduction

The Office2007 style button is very easy to use. Only DragDrop ToolBox.

Copyright :http://www.codeproject.com/KB/office/Office_2007_Button.aspx

->Read More...