Click here to Skip to main content
6,595,444 members and growing! (18,853 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, ASP.NET, Visual Studio, Dev
Posted:14 Aug 2006
Views:15,469
Bookmarked:12 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
11 votes for this article.
Popularity: 1.78 Rating: 1.71 out of 5
7 votes, 63.6%
1

2

3

4
4 votes, 36.4%
5

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


Member
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
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 8 of 8 (Total in Forum: 8) (Refresh)FirstPrevNext
GeneralI need it Pinmemberwlhchypx20:47 20 Nov '08  
GeneralIs the source for XDesignerLib.dll available? PinmemberRajesh Pillai7:28 16 Aug '06  
GeneralYOU MUST WRITE IN PROPER ENGLISH! [modified] PinmemberDario Solera12:54 15 Aug '06  
GeneralRe: YOU MUST WRITE IN PROPER ENGLISH! [modified] Pinmemberi.Posei19:22 15 Aug '06  
GeneralRe: YOU MUST WRITE IN PROPER ENGLISH! Pinmemberdtk19:27 15 Aug '06  
Generalhehe,from china! Pinmemberi.Posei6:42 15 Aug '06  
GeneralRe: hehe,from china! Pinmemberi.Posei6:42 15 Aug '06  
GeneralRe: hehe,from china! Pinmemberi.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-2009
Web22 | Advertise on the Code Project