5,550,131 members and growing! (19,369 online)
Email Password   helpLost your password?
Web Development » ASP.NET » General     Intermediate

Design Web Form use GDI+

By yfyuan

Introduce XHTMLDesigner , it can design Web Form use GDI+
C#, Windows, .NET 1.1, .NET, Visual Studio, ASP.NET, Dev

Posted: 14 Aug 2006
Updated: 14 Aug 2006
Views: 10,621
Bookmarked: 8 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
9 votes for this Article.
Popularity: 1.32 Rating: 1.39 out of 5
7 votes, 77.8%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
0 votes, 0.0%
4
2 votes, 22.2%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article

Sample Image - xhtmldesigner.png

Introduction

XHTMLDesigner is a designer than can design web-form , unlike mostly web-form designer ( eg. VS.NET's web-form designer ) which depend on System.Web.UI , this designer own draw design view by GDI+ . Using GDI+ , it draw vector shape which like web-form control , include input-text , input-radio , input-checkbox , textarea , select . This designer use absolute coordinate , but it can create very simple html document which use flow layout , and the design view is very near with design view , this designer can transform those two coordinate . XHTMLDesigner can save design result to a XML file , or load document from a XML file . In fact , XHTMLDesigner is a application of XDesignerLib .

Using the code

XHTMLDesigner is a application of XDesignerLib , XDesignerLib is a middle ware which use to create WYSWYG designer easy and fast . XDesignerLib already bring a set of design DOOM , people can extend design DOM to create own designer . For example , in XHTMLDesigner , it create a button element by the following C# code :

using System;
using XDesignerDom ;
using XDesignerDom.ControlBase ;
namespace XDesigner.HtmlForm
{
    /// <summary>

    /// HTML&#25353;&#38062;&#23545;&#35937;

    /// </summary>

    public class DesignHtmlButton : DesignButtonBase
    {
        public override bool SaveProperties
               (XDesignerProperty.IPropertyPackage Saver)
        {
            base.WriteBounds( Saver );
            Saver.SetString("id" , strID );
            Saver.SetString("name" , strName );
            Saver.SetString( "classname" , strClassName );
            Saver.SetColor( "textcolor" , this.intTextColor , 
                            System.Drawing.SystemColors.ControlText );
            Saver.SetColor( "backcolor" , this.intBackColor , 
                            System.Drawing.SystemColors.Control );
            Saver.SetString( "text" , strText );
            Saver.SetString("onclickcontent" , strOnClickContent );
            Saver.SetString("value" , strValue );
            Saver.SetFont( "font" , myFont , myOwnerDocument.DefaultFont );
            Saver.SetBoolean("enable" , bolEnable , true );
            return true;
        }
        public override bool LoadProperties
               (XDesignerProperty.IPropertyPackage Loader)
        {
            base.ReadBounds( Loader );
            strID = Loader.GetString("id");
            strName = Loader.GetString("name");
            strText = Loader.GetString("text");
            strClassName = Loader.GetString("classname");
            intTextColor = Loader.GetColor("textcolor" , 
                           System.Drawing.SystemColors.ControlText );
            intBackColor = Loader.GetColor("backcolor" , 
                           System.Drawing.SystemColors.Control );
            strValue = Loader.GetString("value");
            myFont = Loader.GetFont("font" , myOwnerDocument.DefaultFont );
            strOnClickContent = Loader.GetString("onclickcontent");
            bolEnable = Loader.GetBoolean( "enable" , true);
            return true;
        }
        protected string strName = null;
        /// <summary>

        /// &#23545;&#35937;&#21517;&#31216;

        /// </summary>

        public string Name
        {
            get{ return strName;}
            set{ strName = value;}
        }
        protected string strClassName = null;
        public string ClassName
        {
            get{ return strClassName;}
            set{ strClassName = value;}
        }
        protected string strValue = null;
        public string Value
        {
            get{ return strValue ;}
            set{ strValue = value;}
        }
        protected string strOnClickContent = null;
        public string OnClickContent
        {
            get{ return strOnClickContent;}
            set{ strOnClickContent = value;}
        }

        public override string TagName
        {
            get
            {
                return "htmlbutton";
            }
        }

        public DesignHtmlButton()
        {
            this.intTextColor = System.Drawing.SystemColors.ControlText ;
            this.intBackColor = System.Drawing.SystemColors.Control ;
            this.intAlign = System.Drawing.StringAlignment.Center ;
        }
    }
}

Because XHTMLDesigner can save result to a XML file , so other application can handle design result easy , and this XML file can send to XSLT transform .

Points of Interest

Every one know it is very hard to develop a WYSWYG designer , but using XDesignerLib middle ware , you can create your own WYSWYG designer fast and easy . What are you waiting for ? Try it at once .

Learn more information about XHTMLDesigner , please visit http://www.xdesigner.cn/xhtmldesigner/default-eng.htm .

Learn more information about XDesignerLib , please visit http://www.xdesigner.cn/xdesignerlib/default-eng.htm .

Lear more information about author , please visit http://www.xdesigner.cn/default-eng.htm or mail to yyf9989@hotmail.com .

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

yfyuan


yfyuan of XDesigner studio, from CHINA , Spend 170000 lines C# to build a report tool for winform and asp.net , now developing e-form tool . all work in http://www.xdesigner.cn
Occupation: Web Developer
Location: China China

Other popular ASP.NET articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 7 of 7 (Total in Forum: 7) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralIs the source for XDesignerLib.dll available?memberRajesh Pillai7:28 16 Aug '06  
GeneralYOU MUST WRITE IN PROPER ENGLISH! [modified]memberDario Solera12:54 15 Aug '06  
GeneralRe: YOU MUST WRITE IN PROPER ENGLISH! [modified]memberi.Posei19:22 15 Aug '06  
GeneralRe: YOU MUST WRITE IN PROPER ENGLISH!memberdtk19:27 15 Aug '06  
Generalhehe,from china!memberi.Posei6:42 15 Aug '06  
GeneralRe: hehe,from china!memberi.Posei6:42 15 Aug '06  
GeneralRe: hehe,from china!memberi.Posei6:46 15 Aug '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 14 Aug 2006
Editor:
Copyright 2006 by yfyuan
Everything else Copyright © CodeProject, 1999-2008
Web17 | Advertise on the Code Project