Published: 30 Apr 2009
By: Eyal Albert

In this How To we are going to learn the basic usage of Visual WebGui Theme & Control designer.

Contents [hide]

Overview

The Theme & Control designers are some of the new features that will be introduced in version 6.4. These new visual designers enable developers to create or edit a control skin and make custom themes. The Control designer consolidates into one place all the resources that build the control.

In this How to we will show how to edit images that make up a standard button and quickly transform it into a Mac styled button.

Let's Start

Let’s open Visual studio and create a new Visual WebGui application.

Now let’s add a few controls to our main form. Open form1 in design mode and add a few controls.

Next add a new Visual WebGui theme project named 'MyTheme'.

Let’s open Theme1 file in design time and see the theme designer. What you see on the left side of the screen is a list of all the controls that have skins that inherit from ControlSkin. By default a new Theme project template has a reference to Gizmox.WebGUI.Forms.dll and you see the 58 out-of-the-box controls that we have in Visual WebGui in the tree. You can add reference to more .dlls that have controls with skins defined and edit them.

The controls are sorted by name and grouped by inheritance or by containment (Data grid view columns can be used only within a data grid view hens appear underneath it.)

On the right side you can see the files that are associated with the control sorted by type. The files are sorted into seven groups that you can select by using the tool bar.

Let’s select the Button and see the images that build the button controls. The button control is built from a set on images the complete the button that you see. There are 9 images for each button state (Enabled, Disables, Pressed, Hover…). The image below displays a few of the images that are used for the button control.

As you can see each one of the images is marked with an icon /. This icon means that the resource is referenced and not a local resource. This means that this resource belongs to the parent control or that belong to the default theme of the control. You can view the resource but can edit it until you convert the resource to a local resource. Now, right click on one of the images and select the override option this will create the resource as a local resource.

Now we can edit the image. Double click on the image to open it in an edit mode you can set what will be the default editor of a specific file type. In the theme project click on the expend sign next to the theme and see the local resource that was created for the image. Next right click on the image and select the Open with option and then you can select the program to use. I’ve selected Paint.Net but you can use windows paint or any other image processing program.

Now double click on the image and edit it by changing the color or changing the corner to a round corner. Once you are done just save the image and you will see the update in the theme designer.

You can go over all the images in the Button to change all of them. If edited all of them and saved them in a different folder but with the same names. Now I can just take the image and drop them in the theme designer and override all the images.

Now we will see the effect of our changes on the label. First add to our project a reference to the theme; right click on the project and select add reference. Then select the project tab and select our theme and press ok.

Next, open the property page of our application and select our new theme as the application default theme. Right click on the project and select the properties. In the property page select the registration tab.

In the theme section press the 'Add new theme' and select the theme we created. The theme selection dialog displays all the themes that a referenced to the project.

Once you select the theme you want to add press ok and see the theme in the project registered theme. To set the default theme check the checkbox next to it.

Run the application and see the difference.

The default Theme:

This is how our new theme looks like:

Summary

We have just seen how to edit resources in a control and use the new theme we created in our application. Remember that you can edit every resource that the control includes such as CSS files, XSLT or CAML. This ability gives you the power to create new rich UIs for your web applications with Visual WebGui's simplicity.

For more information, visit www.VisualWebGui.com.

<<  Previous Article Continue reading and see our next or previous articles Next Article >>

About Eyal Albert

Sorry, no bio is available

This author has published 6 articles on DotNetSlackers. View other articles or the complete profile here.

Other articles in this category


jQuery Mobile ListView
In this article, we're going to look at what JQuery Mobile uses to represent lists, and how capable ...
JQuery Mobile Widgets Overview
An overview of widgets in jQuery Mobile.
jQuery Mobile Pages
Brian Mains explains how to create pages with the jQuery Mobile framework.
Code First Approach using Entity Framework 4.1, Inversion of Control, Unity Framework, Repository and Unit of Work Patterns, and MVC3 Razor View
A detailed introduction about the code first approach using Entity Framework 4.1, Inversion of Contr...
Exception Handling and .Net (A practical approach)
Error Handling has always been crucial for an application in a number of ways. It may affect the exe...

You might also be interested in the following related blog posts


Designer Support for One-Way navigations in Entity Framework 4 read more
Telerik Releases New Controls for Silverlight 3 and WPF read more
Why VBA Still Makes Sense read more
Ruminations on Multi-Tenant Data Architectures read more
ASP.NET Membership Tip: Requiring New Users To Change Their Password When Logging On For The First Time read more
Server vs. Client Empowered Web Applications read more
Telerik Announces Support for Microsoft Silverlight 3 read more
Silverlight Release History : Q2 2009 (version 2009.2.701) read more
WPF Release History : Q2 2009 (version 2009.2.701) read more
Teleriks Q2 2009 Release Expands All-in-one .NET Offering read more
Top
 
 
 

Please login to rate or to leave a comment.

Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.