diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3e759b7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,330 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+**/Properties/launchSettings.json
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
diff --git a/CustomForm.Designer.cs b/CustomForm.Designer.cs
new file mode 100644
index 0000000..668b778
--- /dev/null
+++ b/CustomForm.Designer.cs
@@ -0,0 +1,58 @@
+namespace Smart.FormDesigner.Demo
+{
+ partial class CustomForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.defaultDesignerLoader1 = new Smart.FormDesigner.Serialization.DefaultDesignerLoader();
+ this.designer1 = new Smart.FormDesigner.Designer();
+ this.SuspendLayout();
+ //
+ // designer1
+ //
+ this.designer1.DesignedForm = this;
+ this.designer1.DesignerLoader = this.defaultDesignerLoader1;
+ this.designer1.GridSize = new System.Drawing.Size(8, 8);
+ //
+ // CustomForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(420, 267);
+ this.KeyPreview = true;
+ this.Name = "CustomForm";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "自定义表单";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ private Serialization.DefaultDesignerLoader defaultDesignerLoader1;
+ private Designer designer1;
+ }
+}
\ No newline at end of file
diff --git a/CustomForm.cs b/CustomForm.cs
new file mode 100644
index 0000000..9a25376
--- /dev/null
+++ b/CustomForm.cs
@@ -0,0 +1,32 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace Smart.FormDesigner.Demo
+{
+ public partial class CustomForm : Form
+ {
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public string LayoutXml
+ {
+ get { return this.designer1.LayoutXML; }
+ set { this.designer1.LayoutXML = value; }
+ }
+
+ public CustomForm()
+ {
+ InitializeComponent();
+ }
+
+ // public 设计时事件可选
+ public void button1_Click(object sender, EventArgs e)
+ {
+ MessageBox.Show("Click1");
+ }
+ public void button1_Click2(object sender, EventArgs e)
+ {
+ MessageBox.Show("Click2");
+ }
+ }
+}
diff --git a/CustomForm.resx b/CustomForm.resx
new file mode 100644
index 0000000..8558451
--- /dev/null
+++ b/CustomForm.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 211, 17
+
+
\ No newline at end of file
diff --git a/DesignerDocument.cs b/DesignerDocument.cs
new file mode 100644
index 0000000..dfd1e1a
--- /dev/null
+++ b/DesignerDocument.cs
@@ -0,0 +1,78 @@
+using System;
+using System.Windows.Forms;
+using WeifenLuo.WinFormsUI.Docking;
+
+namespace Smart.FormDesigner.Demo
+{
+ public class DesignerDocument : DockContent
+ {
+ public DesignerControl DesignerControl { get; private set; }
+ public Designer Designer { get { return this.DesignerControl.Designer; } }
+ public Type RootComponentType { get; }
+
+ public DesignerDocument(string text, Type rootType)
+ {
+ this.Text = text;
+ this.RootComponentType = rootType;
+ InitializeDesigner();
+ }
+
+ private void InitializeDesigner()
+ {
+ var root = (Control)Activator.CreateInstance(RootComponentType);
+ root.Name = RootComponentType.Name;
+ this.DesignerControl = new DesignerControl(root) { Dock = DockStyle.Fill };
+ this.DesignerControl.Designer.KeyDown += DesignedForm_KeyDown;
+ this.Controls.Add(DesignerControl);
+ }
+
+ public void Preview()
+ {
+ var form = new CustomForm();
+ form.LayoutXml = this.DesignerControl.Designer.LayoutXML;
+ form.ShowDialog();
+ }
+
+ private void Form_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ e.Cancel = true;
+ (sender as Form).Hide();
+ }
+
+ private void DesignedForm_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Delete)
+ this.Designer.DeleteSelected();
+ else if (e.KeyCode == Keys.F5)
+ this.Preview();
+ else if (e.Control == true && e.KeyCode == Keys.A)
+ this.Designer.SelectAll();
+ else if (e.Control == true && e.KeyCode == Keys.C)
+ this.Designer.CopyControls();
+ else if (e.Control == true && e.KeyCode == Keys.V)
+ this.Designer.PasteControls();
+ else if (e.Control == true && e.KeyCode == Keys.Z)
+ this.Designer.Undo();
+ else if (e.Control == true && e.KeyCode == Keys.Y)
+ this.Designer.Redo();
+ }
+
+ protected override void OnFormClosed(FormClosedEventArgs e)
+ {
+ this.Designer.KeyDown -= DesignedForm_KeyDown;
+ base.OnFormClosed(e);
+ }
+
+ private void InitializeComponent()
+ {
+ this.SuspendLayout();
+ //
+ // DesignerDocument
+ //
+ this.ClientSize = new System.Drawing.Size(284, 261);
+ this.Name = "DesignerDocument";
+ this.ResumeLayout(false);
+
+ }
+ }
+}
diff --git a/DesignerDocument.resx b/DesignerDocument.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/DesignerDocument.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..c3bb538
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 ljf
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Logo/SUNLIGHT.ico b/Logo/SUNLIGHT.ico
new file mode 100644
index 0000000..2e138f4
Binary files /dev/null and b/Logo/SUNLIGHT.ico differ
diff --git a/Logo/sunlight_logo.ico b/Logo/sunlight_logo.ico
new file mode 100644
index 0000000..2fe6131
Binary files /dev/null and b/Logo/sunlight_logo.ico differ
diff --git a/Logo/sunlight_logo.jpg b/Logo/sunlight_logo.jpg
new file mode 100644
index 0000000..1b98457
Binary files /dev/null and b/Logo/sunlight_logo.jpg differ
diff --git a/Logo/sunlight_logotext.jpg b/Logo/sunlight_logotext.jpg
new file mode 100644
index 0000000..fee7f29
Binary files /dev/null and b/Logo/sunlight_logotext.jpg differ
diff --git a/Logo/sunlight_sc.png b/Logo/sunlight_sc.png
new file mode 100644
index 0000000..5165ad8
Binary files /dev/null and b/Logo/sunlight_sc.png differ
diff --git a/MainForm.cs b/MainForm.cs
new file mode 100644
index 0000000..c86f544
--- /dev/null
+++ b/MainForm.cs
@@ -0,0 +1,938 @@
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.IO;
+using System.Windows.Forms;
+using WeifenLuo.WinFormsUI.Docking;
+
+namespace Smart.FormDesigner.Demo
+{
+ public class MainForm : Form
+ {
+ private ToolboxWindow toolboxWindow;
+ private PropertyWindow propertyWindow;
+ private ToolStripSeparator toolStripSeparator3;
+ private ToolStripButton tbPreview;
+ private ToolStripButton tbDelete;
+ private Designer activeDesigner;
+
+ public MainForm()
+ {
+ InitializeComponent();
+
+ this.toolboxWindow = new ToolboxWindow();
+ this.toolboxWindow.Show(this.dockPanel, DockState.DockLeft);
+
+ this.propertyWindow = new PropertyWindow();
+ this.propertyWindow.Show(this.dockPanel, DockState.DockRight);
+
+ EnableUndoRedo();
+ }
+
+ private void dockPanel_ActiveDocumentChanged(object sender, EventArgs e)
+ {
+ if (this.dockPanel.ActiveDocument is DesignerDocument doc)
+ {
+ this.activeDesigner = doc.Designer;
+ this.SelectionChanged(this.activeDesigner.SelectionService, EventArgs.Empty);
+
+ this.toolboxWindow.Toolbox.Designer = this.activeDesigner;
+
+ this.propertyWindow.Propertybox.SetComponents(this.activeDesigner.DesignerHost.Container.Components);
+
+ this.EnableUndoRedo();
+
+ this.tbPreview.Enabled = true;
+ this.tbSaveForm.Enabled = true;
+ }
+ else
+ {
+ this.tbPreview.Enabled = false;
+ this.tbSaveForm.Enabled = false;
+ }
+ }
+
+ private bool DesignEvents_AddingVerb(IComponent primarySelection, DesignerVerb verb)
+ {
+ return true;
+ }
+ private void SelectionChanged(object sender, EventArgs e)
+ {
+ var selectionService = (ISelectionService)sender;
+ int selectionCount = selectionService.SelectionCount;
+
+ EnableAlignResize(selectionCount > 1);
+ if (selectionCount >= 1)
+ {
+ this.miDeleteSelection.Enabled = true;
+ this.miCopy.Enabled = true;
+ this.tbDelete.Enabled = true;
+ }
+ else
+ {
+ this.miDeleteSelection.Enabled = false;
+ this.miCopy.Enabled = false;
+ this.tbDelete.Enabled = false;
+ }
+
+ this.propertyWindow.Propertybox.Designer = this.activeDesigner;
+ if (selectionCount == 0)
+ {
+ this.propertyWindow.Propertybox.SetSelectedObjects(this.activeDesigner.DesignedForm);
+ }
+ else
+ {
+ var selected = new object[selectionCount];
+ selectionService.GetSelectedComponents().CopyTo(selected, 0);
+ this.propertyWindow.Propertybox.SetSelectedObjects(selected);
+ }
+ }
+ private void ComponentAdded(object sender, ComponentEventArgs e)
+ {
+ this.propertyWindow.Propertybox.SetComponents(this.activeDesigner.DesignerHost.Container.Components);
+
+ EnableUndoRedo();
+ }
+ private void ComponentRemoved(object sender, ComponentEventArgs e)
+ {
+ this.propertyWindow.Propertybox.SetComponents(this.activeDesigner.DesignerHost.Container.Components);
+
+ EnableUndoRedo();
+ }
+ private void ComponentChanged(object sender, ComponentChangedEventArgs e)
+ {
+ EnableUndoRedo();
+ }
+
+ private void NewDesignedForm()
+ {
+ string name = "from " + (this.dockPanel.DocumentsCount + 1);
+ var rootType = typeof(CustomForm);
+
+ var doc = new DesignerDocument(name, rootType);
+ this.activeDesigner = doc.Designer;
+ doc.FormClosing += (s, e) =>
+ {
+ EndDesign(doc.Designer);
+ };
+ doc.Designer.DesignEvents.AddingVerb += DesignEvents_AddingVerb;
+ doc.Designer.SelectionService.SelectionChanged += SelectionChanged;
+ doc.Designer.ComponentChangeService.ComponentAdded += ComponentAdded;
+ doc.Designer.ComponentChangeService.ComponentRemoved += ComponentRemoved;
+ doc.Designer.ComponentChangeService.ComponentChanged += ComponentChanged;
+ doc.Show(dockPanel);
+ tbSaveForm.Enabled = true;
+ }
+ private void OpenDesignedForm()
+ {
+ var openFileName = new OpenFileDialog();
+
+ openFileName.Filter = "XML text format (*.xml)|*.xml|Proprietary text format (*.*)|*.*";
+ openFileName.FilterIndex = 1;
+ openFileName.RestoreDirectory = true;
+
+ if (openFileName.ShowDialog() == DialogResult.OK)
+ {
+ this.NewDesignedForm();
+
+ if (openFileName.FilterIndex == 1)
+ {
+ var txtReader = new StreamReader(openFileName.FileName);
+ string layoutString = txtReader.ReadToEnd();
+ txtReader.Close();
+
+ this.activeDesigner.LayoutXML = layoutString;
+ }
+ else
+ {
+ this.activeDesigner.LoadFromFile(openFileName.FileName);
+ }
+ tbSaveForm.Enabled = true;
+ }
+ }
+ private void SaveDesignedForm()
+ {
+ var saveFileName = new SaveFileDialog();
+ saveFileName.Filter = "XML Form (*.xml)|*.xml";
+ saveFileName.FilterIndex = 1;
+ saveFileName.RestoreDirectory = true;
+
+ if (saveFileName.ShowDialog() == DialogResult.OK)
+ {
+ string test = this.activeDesigner.LayoutXML;
+
+ TextWriter txtWriter = new StreamWriter(saveFileName.FileName);
+ txtWriter.Write(test);
+ txtWriter.Close();
+ }
+ }
+ private void CheckDesignedForm()
+ {
+ if (this.activeDesigner.IsDirty == true)
+ {
+ if (MessageBox.Show("是否保存对表单的修改?", "确认提示",
+ MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+ {
+ SaveDesignedForm();
+ }
+ }
+ }
+ private void EndDesign(Designer designer)
+ {
+ if (designer == null) return;
+
+ designer.SelectionService.SelectionChanged -= SelectionChanged;
+ designer.ComponentChangeService.ComponentAdded -= ComponentAdded;
+ designer.ComponentChangeService.ComponentRemoved -= ComponentRemoved;
+ designer.ComponentChangeService.ComponentChanged -= ComponentChanged;
+ CheckDesignedForm();
+ designer.Active = false;
+ designer.DesignContainer = null;
+ }
+
+ private void EnableAlignResize(bool enable)
+ {
+ this.miAlignBottom.Enabled = enable;
+ this.miAlignMiddle.Enabled = enable;
+ this.miAlignTop.Enabled = enable;
+ this.miAlignCenter.Enabled = enable;
+ this.miAlignRight.Enabled = enable;
+ this.miAlignLeft.Enabled = enable;
+
+ this.tbAlignBottom.Enabled = enable;
+ this.tbAlignMiddle.Enabled = enable;
+ this.tbAlignTop.Enabled = enable;
+ this.tbAlignCenter.Enabled = enable;
+ this.tbAlignLeft.Enabled = enable;
+ this.tbAlignRight.Enabled = enable;
+
+ this.miSameBoth.Enabled = enable;
+ this.miSameWidth.Enabled = enable;
+ this.miSameHeight.Enabled = enable;
+
+ this.tbSameBoth.Enabled = enable;
+ this.tbSameWidth.Enabled = enable;
+ this.tbSameHeight.Enabled = enable;
+ }
+ private void EnableUndoRedo()
+ {
+ miUndo.Enabled = (this.activeDesigner?.UndoCount > 0);
+ miRedo.Enabled = (this.activeDesigner?.RedoCount > 0);
+
+ tbUndo.Enabled = (this.activeDesigner?.UndoCount > 0);
+ tbRedo.Enabled = (this.activeDesigner?.RedoCount > 0);
+ }
+
+ #region 菜单事件
+
+ private void miNewForm_Click(object sender, EventArgs e)
+ {
+ NewDesignedForm();
+ }
+ private void miOpenForm_Click(object sender, System.EventArgs e)
+ {
+ OpenDesignedForm();
+ }
+ private void miSaveForm_Click(object sender, System.EventArgs e)
+ {
+ SaveDesignedForm();
+ }
+ private void miExitDesigner_Click(object sender, EventArgs e)
+ {
+ Close();
+ }
+ private void tbPreview_Click(object sender, EventArgs e)
+ {
+ if (this.dockPanel.ActiveDocument is DesignerDocument doc)
+ {
+ doc.Preview();
+ }
+ }
+ private void tbDelete_Click(object sender, EventArgs e)
+ {
+ if (this.dockPanel.ActiveDocument is DesignerDocument doc)
+ {
+ doc.Designer.DeleteSelected();
+ }
+ }
+ private void miAlignTop_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.Align(AlignType.Top);
+ }
+ private void miAlignMiddle_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.Align(AlignType.Middle);
+ }
+ private void miAlignBottom_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.Align(AlignType.Bottom);
+ }
+ private void miAlignLeft_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.Align(AlignType.Left);
+ }
+ private void miAlignCenter_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.Align(AlignType.Center);
+ }
+ private void miAlignRight_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.Align(AlignType.Right);
+ }
+
+ private void miSameHeight_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.MakeSameSize(ResizeType.SameHeight);
+ }
+ private void miSameWidth_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.MakeSameSize(ResizeType.SameWidth);
+ }
+ private void miSameBoth_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.MakeSameSize(ResizeType.SameHeight | ResizeType.SameWidth);
+ }
+ private void miUndo_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.Undo();
+ miUndo.Enabled = (this.activeDesigner.UndoCount != 0);
+ miRedo.Enabled = (this.activeDesigner.RedoCount != 0);
+ }
+ private void miRedo_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.Redo();
+ miUndo.Enabled = (this.activeDesigner.UndoCount != 0);
+ miRedo.Enabled = (this.activeDesigner.RedoCount != 0);
+ }
+ private void miDeleteSelection_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.DeleteSelected();
+ }
+
+ private void miCopy_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.CopyControls();
+ }
+ private void miPaste_Click(object sender, System.EventArgs e)
+ {
+ this.activeDesigner.PasteControls();
+ }
+
+ private void miAbout_Click(object sender, System.EventArgs e)
+ {
+ MessageBox.Show("Smart Form Designer" + Environment.NewLine +
+ "Copyright © 2018 SmallAnts",
+ "关于",
+ MessageBoxButtons.OK);
+ }
+ #endregion
+
+ protected override void Dispose(bool disposing)
+ {
+ this.toolboxWindow.Dispose();
+ this.propertyWindow.Dispose();
+
+ if (disposing)
+ {
+ if (components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.mainMenu = new System.Windows.Forms.MainMenu(this.components);
+ this.menuItem1 = new System.Windows.Forms.MenuItem();
+ this.miNewForm = new System.Windows.Forms.MenuItem();
+ this.miOpenForm = new System.Windows.Forms.MenuItem();
+ this.miSaveForm = new System.Windows.Forms.MenuItem();
+ this.menuItem6 = new System.Windows.Forms.MenuItem();
+ this.miExitDesigner = new System.Windows.Forms.MenuItem();
+ this.menuItem2 = new System.Windows.Forms.MenuItem();
+ this.miUndo = new System.Windows.Forms.MenuItem();
+ this.miRedo = new System.Windows.Forms.MenuItem();
+ this.menuItem11 = new System.Windows.Forms.MenuItem();
+ this.menuItem8 = new System.Windows.Forms.MenuItem();
+ this.miAlignTop = new System.Windows.Forms.MenuItem();
+ this.miAlignMiddle = new System.Windows.Forms.MenuItem();
+ this.miAlignBottom = new System.Windows.Forms.MenuItem();
+ this.menuItem12 = new System.Windows.Forms.MenuItem();
+ this.miAlignLeft = new System.Windows.Forms.MenuItem();
+ this.miAlignCenter = new System.Windows.Forms.MenuItem();
+ this.miAlignRight = new System.Windows.Forms.MenuItem();
+ this.menuItem9 = new System.Windows.Forms.MenuItem();
+ this.miSameHeight = new System.Windows.Forms.MenuItem();
+ this.miSameWidth = new System.Windows.Forms.MenuItem();
+ this.menuItem13 = new System.Windows.Forms.MenuItem();
+ this.miSameBoth = new System.Windows.Forms.MenuItem();
+ this.menuItem14 = new System.Windows.Forms.MenuItem();
+ this.miCopy = new System.Windows.Forms.MenuItem();
+ this.miPaste = new System.Windows.Forms.MenuItem();
+ this.miDeleteSelection = new System.Windows.Forms.MenuItem();
+ this.menuItem4 = new System.Windows.Forms.MenuItem();
+ this.miAbout = new System.Windows.Forms.MenuItem();
+ this.toolStrip = new System.Windows.Forms.ToolStrip();
+ this.tbNewForm = new System.Windows.Forms.ToolStripButton();
+ this.tbOpenForm = new System.Windows.Forms.ToolStripButton();
+ this.tbSaveForm = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this.tbPreview = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.tbUndo = new System.Windows.Forms.ToolStripButton();
+ this.tbRedo = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.tbDelete = new System.Windows.Forms.ToolStripButton();
+ this.tbAlignLeft = new System.Windows.Forms.ToolStripButton();
+ this.tbAlignCenter = new System.Windows.Forms.ToolStripButton();
+ this.tbAlignRight = new System.Windows.Forms.ToolStripButton();
+ this.tbAlignTop = new System.Windows.Forms.ToolStripButton();
+ this.tbAlignMiddle = new System.Windows.Forms.ToolStripButton();
+ this.tbAlignBottom = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
+ this.tbSameWidth = new System.Windows.Forms.ToolStripButton();
+ this.tbSameHeight = new System.Windows.Forms.ToolStripButton();
+ this.tbSameBoth = new System.Windows.Forms.ToolStripButton();
+ this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
+ this.vS2015LightTheme1 = new WeifenLuo.WinFormsUI.Docking.VS2015LightTheme();
+ this.toolStrip.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // mainMenu
+ //
+ this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+ this.menuItem1,
+ this.menuItem2,
+ this.menuItem4});
+ //
+ // menuItem1
+ //
+ this.menuItem1.Index = 0;
+ this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+ this.miNewForm,
+ this.miOpenForm,
+ this.miSaveForm,
+ this.menuItem6,
+ this.miExitDesigner});
+ this.menuItem1.Text = "文件(&F)";
+ //
+ // miNewForm
+ //
+ this.miNewForm.Index = 0;
+ this.miNewForm.Shortcut = System.Windows.Forms.Shortcut.CtrlN;
+ this.miNewForm.Text = "新建(&N)";
+ this.miNewForm.Click += new System.EventHandler(this.miNewForm_Click);
+ //
+ // miOpenForm
+ //
+ this.miOpenForm.Index = 1;
+ this.miOpenForm.Shortcut = System.Windows.Forms.Shortcut.CtrlO;
+ this.miOpenForm.Text = "打开(&O)";
+ this.miOpenForm.Click += new System.EventHandler(this.miOpenForm_Click);
+ //
+ // miSaveForm
+ //
+ this.miSaveForm.Index = 2;
+ this.miSaveForm.Shortcut = System.Windows.Forms.Shortcut.CtrlS;
+ this.miSaveForm.Text = "保存(&S)";
+ this.miSaveForm.Click += new System.EventHandler(this.miSaveForm_Click);
+ //
+ // menuItem6
+ //
+ this.menuItem6.Index = 3;
+ this.menuItem6.Text = "-";
+ //
+ // miExitDesigner
+ //
+ this.miExitDesigner.Index = 4;
+ this.miExitDesigner.Text = "退出(&X)";
+ this.miExitDesigner.Click += new System.EventHandler(this.miExitDesigner_Click);
+ //
+ // menuItem2
+ //
+ this.menuItem2.Index = 1;
+ this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+ this.miUndo,
+ this.miRedo,
+ this.menuItem11,
+ this.menuItem8,
+ this.menuItem9,
+ this.menuItem14,
+ this.miCopy,
+ this.miPaste,
+ this.miDeleteSelection});
+ this.menuItem2.Text = "编辑(&E)";
+ //
+ // miUndo
+ //
+ this.miUndo.Index = 0;
+ this.miUndo.Shortcut = System.Windows.Forms.Shortcut.CtrlZ;
+ this.miUndo.Text = "撤销(&U)";
+ this.miUndo.Click += new System.EventHandler(this.miUndo_Click);
+ //
+ // miRedo
+ //
+ this.miRedo.Index = 1;
+ this.miRedo.Shortcut = System.Windows.Forms.Shortcut.CtrlY;
+ this.miRedo.Text = "重做(&R)";
+ this.miRedo.Click += new System.EventHandler(this.miRedo_Click);
+ //
+ // menuItem11
+ //
+ this.menuItem11.Index = 2;
+ this.menuItem11.Text = "-";
+ //
+ // menuItem8
+ //
+ this.menuItem8.Index = 3;
+ this.menuItem8.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+ this.miAlignTop,
+ this.miAlignMiddle,
+ this.miAlignBottom,
+ this.menuItem12,
+ this.miAlignLeft,
+ this.miAlignCenter,
+ this.miAlignRight});
+ this.menuItem8.Text = "对齐(&A)";
+ //
+ // miAlignTop
+ //
+ this.miAlignTop.Index = 0;
+ this.miAlignTop.Text = "&Top";
+ this.miAlignTop.Click += new System.EventHandler(this.miAlignTop_Click);
+ //
+ // miAlignMiddle
+ //
+ this.miAlignMiddle.Index = 1;
+ this.miAlignMiddle.Text = "&Middle";
+ this.miAlignMiddle.Click += new System.EventHandler(this.miAlignMiddle_Click);
+ //
+ // miAlignBottom
+ //
+ this.miAlignBottom.Index = 2;
+ this.miAlignBottom.Text = "&Bottom";
+ this.miAlignBottom.Click += new System.EventHandler(this.miAlignBottom_Click);
+ //
+ // menuItem12
+ //
+ this.menuItem12.Index = 3;
+ this.menuItem12.Text = "-";
+ //
+ // miAlignLeft
+ //
+ this.miAlignLeft.Index = 4;
+ this.miAlignLeft.Text = "&Left";
+ this.miAlignLeft.Click += new System.EventHandler(this.miAlignLeft_Click);
+ //
+ // miAlignCenter
+ //
+ this.miAlignCenter.Index = 5;
+ this.miAlignCenter.Text = "&Center";
+ this.miAlignCenter.Click += new System.EventHandler(this.miAlignCenter_Click);
+ //
+ // miAlignRight
+ //
+ this.miAlignRight.Index = 6;
+ this.miAlignRight.Text = "&Right";
+ this.miAlignRight.Click += new System.EventHandler(this.miAlignRight_Click);
+ //
+ // menuItem9
+ //
+ this.menuItem9.Index = 4;
+ this.menuItem9.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+ this.miSameHeight,
+ this.miSameWidth,
+ this.menuItem13,
+ this.miSameBoth});
+ this.menuItem9.Text = "使用相同(&M)";
+ //
+ // miSameHeight
+ //
+ this.miSameHeight.Index = 0;
+ this.miSameHeight.Text = "Same &Height";
+ this.miSameHeight.Click += new System.EventHandler(this.miSameHeight_Click);
+ //
+ // miSameWidth
+ //
+ this.miSameWidth.Index = 1;
+ this.miSameWidth.Text = "Same &Width";
+ this.miSameWidth.Click += new System.EventHandler(this.miSameWidth_Click);
+ //
+ // menuItem13
+ //
+ this.menuItem13.Index = 2;
+ this.menuItem13.Text = "-";
+ //
+ // miSameBoth
+ //
+ this.miSameBoth.Index = 3;
+ this.miSameBoth.Text = "Same &Both";
+ this.miSameBoth.Click += new System.EventHandler(this.miSameBoth_Click);
+ //
+ // menuItem14
+ //
+ this.menuItem14.Index = 5;
+ this.menuItem14.Text = "-";
+ //
+ // miCopy
+ //
+ this.miCopy.Index = 6;
+ this.miCopy.Shortcut = System.Windows.Forms.Shortcut.CtrlC;
+ this.miCopy.Text = "复制(&C)";
+ this.miCopy.Click += new System.EventHandler(this.miCopy_Click);
+ //
+ // miPaste
+ //
+ this.miPaste.Index = 7;
+ this.miPaste.Shortcut = System.Windows.Forms.Shortcut.CtrlV;
+ this.miPaste.Text = "粘贴(&P)";
+ this.miPaste.Click += new System.EventHandler(this.miPaste_Click);
+ //
+ // miDeleteSelection
+ //
+ this.miDeleteSelection.Index = 8;
+ this.miDeleteSelection.Shortcut = System.Windows.Forms.Shortcut.Del;
+ this.miDeleteSelection.Text = "删除(&D)";
+ this.miDeleteSelection.Click += new System.EventHandler(this.miDeleteSelection_Click);
+ //
+ // menuItem4
+ //
+ this.menuItem4.Index = 2;
+ this.menuItem4.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+ this.miAbout});
+ this.menuItem4.Text = "帮助(&H)";
+ //
+ // miAbout
+ //
+ this.miAbout.Index = 0;
+ this.miAbout.Text = "关于(&A)";
+ this.miAbout.Click += new System.EventHandler(this.miAbout_Click);
+ //
+ // toolStrip
+ //
+ this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tbNewForm,
+ this.tbOpenForm,
+ this.tbSaveForm,
+ this.toolStripSeparator3,
+ this.tbPreview,
+ this.toolStripSeparator2,
+ this.tbUndo,
+ this.tbRedo,
+ this.toolStripSeparator1,
+ this.tbDelete,
+ this.tbAlignLeft,
+ this.tbAlignCenter,
+ this.tbAlignRight,
+ this.tbAlignTop,
+ this.tbAlignMiddle,
+ this.tbAlignBottom,
+ this.toolStripSeparator4,
+ this.tbSameWidth,
+ this.tbSameHeight,
+ this.tbSameBoth});
+ this.toolStrip.Location = new System.Drawing.Point(0, 0);
+ this.toolStrip.Name = "toolStrip";
+ this.toolStrip.Size = new System.Drawing.Size(1008, 25);
+ this.toolStrip.TabIndex = 7;
+ this.toolStrip.Text = "toolStrip1";
+ //
+ // tbNewForm
+ //
+ this.tbNewForm.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbNewForm.Image = global::Smart.FormDesigner.Demo.Properties.Resources.new_from_16x;
+ this.tbNewForm.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbNewForm.Name = "tbNewForm";
+ this.tbNewForm.Size = new System.Drawing.Size(23, 22);
+ this.tbNewForm.Text = "新建表单";
+ this.tbNewForm.ToolTipText = "新建表单 (Ctrl + N)";
+ this.tbNewForm.Click += new System.EventHandler(this.miNewForm_Click);
+ //
+ // tbOpenForm
+ //
+ this.tbOpenForm.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbOpenForm.Image = global::Smart.FormDesigner.Demo.Properties.Resources.open_file_16x;
+ this.tbOpenForm.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbOpenForm.Name = "tbOpenForm";
+ this.tbOpenForm.Size = new System.Drawing.Size(23, 22);
+ this.tbOpenForm.Text = "打开文件";
+ this.tbOpenForm.ToolTipText = "打开文件 (Ctrl + O)";
+ this.tbOpenForm.Click += new System.EventHandler(this.miOpenForm_Click);
+ //
+ // tbSaveForm
+ //
+ this.tbSaveForm.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbSaveForm.Enabled = false;
+ this.tbSaveForm.Image = global::Smart.FormDesigner.Demo.Properties.Resources.save_16x;
+ this.tbSaveForm.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbSaveForm.Name = "tbSaveForm";
+ this.tbSaveForm.Size = new System.Drawing.Size(23, 22);
+ this.tbSaveForm.Text = "保存表单";
+ this.tbSaveForm.ToolTipText = "保存表单 (Ctrl + S)";
+ this.tbSaveForm.Click += new System.EventHandler(this.miSaveForm_Click);
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
+ //
+ // tbPreview
+ //
+ this.tbPreview.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbPreview.Enabled = false;
+ this.tbPreview.Image = global::Smart.FormDesigner.Demo.Properties.Resources.preview_16x;
+ this.tbPreview.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbPreview.Name = "tbPreview";
+ this.tbPreview.Size = new System.Drawing.Size(23, 22);
+ this.tbPreview.Text = "预览";
+ this.tbPreview.ToolTipText = "预览 (F5)";
+ this.tbPreview.Click += new System.EventHandler(this.tbPreview_Click);
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
+ //
+ // tbUndo
+ //
+ this.tbUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbUndo.Enabled = false;
+ this.tbUndo.Image = global::Smart.FormDesigner.Demo.Properties.Resources.undo_16x;
+ this.tbUndo.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbUndo.Name = "tbUndo";
+ this.tbUndo.Size = new System.Drawing.Size(23, 22);
+ this.tbUndo.Text = "撤销(Ctrl+Z)";
+ this.tbUndo.Click += new System.EventHandler(this.miUndo_Click);
+ //
+ // tbRedo
+ //
+ this.tbRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbRedo.Enabled = false;
+ this.tbRedo.Image = global::Smart.FormDesigner.Demo.Properties.Resources.redo_16x;
+ this.tbRedo.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbRedo.Name = "tbRedo";
+ this.tbRedo.Size = new System.Drawing.Size(23, 22);
+ this.tbRedo.Text = "重做(Ctrl+Y)";
+ this.tbRedo.Click += new System.EventHandler(this.miRedo_Click);
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ //
+ // tbDelete
+ //
+ this.tbDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbDelete.Enabled = false;
+ this.tbDelete.Image = global::Smart.FormDesigner.Demo.Properties.Resources.delete_16x;
+ this.tbDelete.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbDelete.Name = "tbDelete";
+ this.tbDelete.Size = new System.Drawing.Size(23, 22);
+ this.tbDelete.Text = "删除选中项";
+ this.tbDelete.Click += new System.EventHandler(this.tbDelete_Click);
+ //
+ // tbAlignLeft
+ //
+ this.tbAlignLeft.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbAlignLeft.Enabled = false;
+ this.tbAlignLeft.Image = global::Smart.FormDesigner.Demo.Properties.Resources.align_left_16x;
+ this.tbAlignLeft.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbAlignLeft.Name = "tbAlignLeft";
+ this.tbAlignLeft.Size = new System.Drawing.Size(23, 22);
+ this.tbAlignLeft.Text = "左对齐";
+ this.tbAlignLeft.Click += new System.EventHandler(this.miAlignLeft_Click);
+ //
+ // tbAlignCenter
+ //
+ this.tbAlignCenter.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbAlignCenter.Enabled = false;
+ this.tbAlignCenter.Image = global::Smart.FormDesigner.Demo.Properties.Resources.align_center_16x;
+ this.tbAlignCenter.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbAlignCenter.Name = "tbAlignCenter";
+ this.tbAlignCenter.Size = new System.Drawing.Size(23, 22);
+ this.tbAlignCenter.Text = "居中对齐";
+ this.tbAlignCenter.Click += new System.EventHandler(this.miAlignCenter_Click);
+ //
+ // tbAlignRight
+ //
+ this.tbAlignRight.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbAlignRight.Enabled = false;
+ this.tbAlignRight.Image = global::Smart.FormDesigner.Demo.Properties.Resources.align_right_16x;
+ this.tbAlignRight.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbAlignRight.Name = "tbAlignRight";
+ this.tbAlignRight.Size = new System.Drawing.Size(23, 22);
+ this.tbAlignRight.Text = "右对齐";
+ this.tbAlignRight.Click += new System.EventHandler(this.miAlignRight_Click);
+ //
+ // tbAlignTop
+ //
+ this.tbAlignTop.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbAlignTop.Enabled = false;
+ this.tbAlignTop.Image = global::Smart.FormDesigner.Demo.Properties.Resources.align_top_16x;
+ this.tbAlignTop.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbAlignTop.Name = "tbAlignTop";
+ this.tbAlignTop.Size = new System.Drawing.Size(23, 22);
+ this.tbAlignTop.Text = "顶端对齐";
+ this.tbAlignTop.Click += new System.EventHandler(this.miAlignTop_Click);
+ //
+ // tbAlignMiddle
+ //
+ this.tbAlignMiddle.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbAlignMiddle.Enabled = false;
+ this.tbAlignMiddle.Image = global::Smart.FormDesigner.Demo.Properties.Resources.align_middlle_16x;
+ this.tbAlignMiddle.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbAlignMiddle.Name = "tbAlignMiddle";
+ this.tbAlignMiddle.Size = new System.Drawing.Size(23, 22);
+ this.tbAlignMiddle.Text = "中间对齐";
+ this.tbAlignMiddle.Click += new System.EventHandler(this.miAlignMiddle_Click);
+ //
+ // tbAlignBottom
+ //
+ this.tbAlignBottom.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbAlignBottom.Enabled = false;
+ this.tbAlignBottom.Image = global::Smart.FormDesigner.Demo.Properties.Resources.align_bottom_16x;
+ this.tbAlignBottom.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbAlignBottom.Name = "tbAlignBottom";
+ this.tbAlignBottom.Size = new System.Drawing.Size(23, 22);
+ this.tbAlignBottom.Text = "底端对齐";
+ this.tbAlignBottom.Click += new System.EventHandler(this.miAlignBottom_Click);
+ //
+ // toolStripSeparator4
+ //
+ this.toolStripSeparator4.Name = "toolStripSeparator4";
+ this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
+ //
+ // tbSameWidth
+ //
+ this.tbSameWidth.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbSameWidth.Enabled = false;
+ this.tbSameWidth.Image = global::Smart.FormDesigner.Demo.Properties.Resources.same_width_16x;
+ this.tbSameWidth.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbSameWidth.Name = "tbSameWidth";
+ this.tbSameWidth.Size = new System.Drawing.Size(23, 22);
+ this.tbSameWidth.Text = "使宽度相同";
+ this.tbSameWidth.Click += new System.EventHandler(this.miSameWidth_Click);
+ //
+ // tbSameHeight
+ //
+ this.tbSameHeight.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbSameHeight.Enabled = false;
+ this.tbSameHeight.Image = global::Smart.FormDesigner.Demo.Properties.Resources.same_height_16x;
+ this.tbSameHeight.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbSameHeight.Name = "tbSameHeight";
+ this.tbSameHeight.Size = new System.Drawing.Size(23, 22);
+ this.tbSameHeight.Text = "使高度相同";
+ this.tbSameHeight.Click += new System.EventHandler(this.miSameHeight_Click);
+ //
+ // tbSameBoth
+ //
+ this.tbSameBoth.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tbSameBoth.Enabled = false;
+ this.tbSameBoth.Image = global::Smart.FormDesigner.Demo.Properties.Resources.same_size_16x;
+ this.tbSameBoth.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+ this.tbSameBoth.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbSameBoth.Name = "tbSameBoth";
+ this.tbSameBoth.Size = new System.Drawing.Size(23, 22);
+ this.tbSameBoth.Text = "使大小相同";
+ this.tbSameBoth.Click += new System.EventHandler(this.miSameBoth_Click);
+ //
+ // dockPanel
+ //
+ this.dockPanel.AllowEndUserDocking = false;
+ this.dockPanel.AllowEndUserNestedDocking = false;
+ this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.dockPanel.DockBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(242)))));
+ this.dockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow;
+ this.dockPanel.Location = new System.Drawing.Point(0, 25);
+ this.dockPanel.Name = "dockPanel";
+ this.dockPanel.Padding = new System.Windows.Forms.Padding(6);
+ this.dockPanel.ShowAutoHideContentOnHover = false;
+ this.dockPanel.ShowDocumentIcon = true;
+ this.dockPanel.Size = new System.Drawing.Size(1008, 552);
+ this.dockPanel.TabIndex = 8;
+ this.dockPanel.Theme = this.vS2015LightTheme1;
+ this.dockPanel.ActiveDocumentChanged += new System.EventHandler(this.dockPanel_ActiveDocumentChanged);
+ //
+ // MainForm
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(1008, 577);
+ this.Controls.Add(this.dockPanel);
+ this.Controls.Add(this.toolStrip);
+ this.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+ this.Menu = this.mainMenu;
+ this.Name = "MainForm";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "表单设计器";
+ this.toolStrip.ResumeLayout(false);
+ this.toolStrip.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ private IContainer components;
+
+ private MainMenu mainMenu;
+ private MenuItem miNewForm;
+ private MenuItem miOpenForm;
+ private MenuItem miSaveForm;
+ private MenuItem miExitDesigner;
+ private MenuItem miCopy;
+ private MenuItem miPaste;
+ private MenuItem miUndo;
+ private MenuItem miRedo;
+ private MenuItem miAlignTop;
+ private MenuItem miAlignMiddle;
+ private MenuItem miAlignBottom;
+ private MenuItem miAlignLeft;
+ private MenuItem miAlignCenter;
+ private MenuItem miAlignRight;
+ private MenuItem miSameHeight;
+ private MenuItem miSameWidth;
+ private MenuItem miSameBoth;
+ private MenuItem miDeleteSelection;
+ private MenuItem miAbout;
+ private MenuItem menuItem1;
+ private MenuItem menuItem2;
+ private MenuItem menuItem4;
+ private MenuItem menuItem6;
+ private MenuItem menuItem8;
+ private MenuItem menuItem9;
+ private MenuItem menuItem11;
+ private MenuItem menuItem12;
+ private MenuItem menuItem13;
+ private MenuItem menuItem14;
+
+ private ToolStrip toolStrip;
+ private ToolStripButton tbNewForm;
+ private ToolStripButton tbOpenForm;
+ private ToolStripButton tbSaveForm;
+ private ToolStripButton tbUndo;
+ private ToolStripButton tbRedo;
+ private ToolStripButton tbAlignLeft;
+ private ToolStripButton tbAlignCenter;
+ private ToolStripButton tbAlignRight;
+ private ToolStripButton tbAlignTop;
+ private ToolStripButton tbAlignMiddle;
+ private ToolStripButton tbAlignBottom;
+ private ToolStripButton tbSameWidth;
+ private ToolStripButton tbSameHeight;
+ private ToolStripButton tbSameBoth;
+ private ToolStripSeparator toolStripSeparator1;
+ private ToolStripSeparator toolStripSeparator2;
+ private ToolStripSeparator toolStripSeparator4;
+
+ private DockPanel dockPanel;
+ private VS2015LightTheme vS2015LightTheme1;
+
+ #endregion
+
+
+ }
+}
diff --git a/MainForm.resx b/MainForm.resx
new file mode 100644
index 0000000..54b1a3b
--- /dev/null
+++ b/MainForm.resx
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 13, 10
+
+
+ 116, 11
+
+
+ 219, 11
+
+
+ 47
+
+
\ No newline at end of file
diff --git a/Program.cs b/Program.cs
new file mode 100644
index 0000000..1b96df5
--- /dev/null
+++ b/Program.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Windows.Forms;
+
+namespace Smart.FormDesigner.Demo
+{
+ static class Program
+ {
+ ///
+ /// 应用程序的主入口点。
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainForm());
+ }
+ }
+}
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..16f7fbe
--- /dev/null
+++ b/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("Smart.FormDesigner.Demo")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Smart.FormDesigner.Demo")]
+[assembly: AssemblyCopyright("Copyright © 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("f0c044e1-0530-424e-be99-d182c9f5de99")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..4439379
--- /dev/null
+++ b/Properties/Resources.Designer.cs
@@ -0,0 +1,233 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace Smart.FormDesigner.Demo.Properties {
+ using System;
+
+
+ ///
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// 返回此类使用的缓存的 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Smart.FormDesigner.Demo.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 重写当前线程的 CurrentUICulture 属性,对
+ /// 使用此强类型资源类的所有资源查找执行重写。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap align_bottom_16x {
+ get {
+ object obj = ResourceManager.GetObject("align_bottom_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap align_center_16x {
+ get {
+ object obj = ResourceManager.GetObject("align_center_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap align_left_16x {
+ get {
+ object obj = ResourceManager.GetObject("align_left_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap align_middlle_16x {
+ get {
+ object obj = ResourceManager.GetObject("align_middlle_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap align_right_16x {
+ get {
+ object obj = ResourceManager.GetObject("align_right_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap align_top_16x {
+ get {
+ object obj = ResourceManager.GetObject("align_top_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap delete_16x {
+ get {
+ object obj = ResourceManager.GetObject("delete_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap new_from_16x {
+ get {
+ object obj = ResourceManager.GetObject("new_from_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap open_file_16x {
+ get {
+ object obj = ResourceManager.GetObject("open_file_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap preview_16x {
+ get {
+ object obj = ResourceManager.GetObject("preview_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap redo_16x {
+ get {
+ object obj = ResourceManager.GetObject("redo_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap same_height_16x {
+ get {
+ object obj = ResourceManager.GetObject("same_height_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap same_size_16x {
+ get {
+ object obj = ResourceManager.GetObject("same_size_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap same_width_16x {
+ get {
+ object obj = ResourceManager.GetObject("same_width_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap save_16x {
+ get {
+ object obj = ResourceManager.GetObject("save_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap save_all_16x {
+ get {
+ object obj = ResourceManager.GetObject("save_all_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap undo_16x {
+ get {
+ object obj = ResourceManager.GetObject("undo_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
new file mode 100644
index 0000000..d24dd3c
--- /dev/null
+++ b/Properties/Resources.resx
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\images\align_top_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\save_all_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\undo_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\align_center_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\align_bottom_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\align_left_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\same_height_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\preview_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\align_middlle_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\redo_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\save_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\align_right_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\new_form_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\same_size_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\same_width_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\open_file_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\images\delete_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..f98237a
--- /dev/null
+++ b/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace Smart.FormDesigner.Demo.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Properties/Settings.settings b/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/PropertyWindow.Designer.cs b/PropertyWindow.Designer.cs
new file mode 100644
index 0000000..0fb5962
--- /dev/null
+++ b/PropertyWindow.Designer.cs
@@ -0,0 +1,58 @@
+namespace Smart.FormDesigner.Demo
+{
+ partial class PropertyWindow
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.Propertybox = new Smart.FormDesigner.Demo.PropertyboxControl();
+ this.SuspendLayout();
+ //
+ // Propertybox
+ //
+ this.Propertybox.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.Propertybox.Location = new System.Drawing.Point(0, 0);
+ this.Propertybox.Name = "Propertybox";
+ this.Propertybox.Size = new System.Drawing.Size(204, 461);
+ this.Propertybox.TabIndex = 0;
+ //
+ // PropertyWindow
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(204, 461);
+ this.Controls.Add(this.Propertybox);
+ this.Name = "PropertyWindow";
+ this.Text = "属性";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ internal PropertyboxControl Propertybox;
+ }
+}
\ No newline at end of file
diff --git a/PropertyWindow.cs b/PropertyWindow.cs
new file mode 100644
index 0000000..8a106a9
--- /dev/null
+++ b/PropertyWindow.cs
@@ -0,0 +1,15 @@
+using System.Windows.Forms;
+using WeifenLuo.WinFormsUI.Docking;
+
+namespace Smart.FormDesigner.Demo
+{
+ public partial class PropertyWindow : DockContent
+ {
+ public PropertyWindow()
+ {
+ InitializeComponent();
+ this.Propertybox.ShowEventTab = true;
+ }
+
+ }
+}
diff --git a/PropertyWindow.resx b/PropertyWindow.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/PropertyWindow.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Smart.FormDesigner.Demo.csproj b/Smart.FormDesigner.Demo.csproj
new file mode 100644
index 0000000..0f51603
--- /dev/null
+++ b/Smart.FormDesigner.Demo.csproj
@@ -0,0 +1,145 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {F0C044E1-0530-424E-BE99-D182C9F5DE99}
+ WinExe
+ Smart.FormDesigner.Demo
+ Smart.FormDesigner.Demo
+ v4.6.2
+ 512
+ true
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ false
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ false
+
+
+
+ packages\Smart.FormDesigner.1.2.0\lib\net40\Smart.FormDesigner.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ packages\DockPanelSuite.3.0.6\lib\net40\WeifenLuo.WinFormsUI.Docking.dll
+
+
+ packages\DockPanelSuite.ThemeVS2015.3.0.6\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll
+
+
+
+
+ Form
+
+
+ Form
+
+
+ Form
+
+
+ CustomForm.cs
+
+
+
+
+ Form
+
+
+ PropertyWindow.cs
+
+
+ Form
+
+
+ ToolboxWindow.cs
+
+
+ DesignerDocument.cs
+
+
+ MainForm.cs
+ Designer
+
+
+ CustomForm.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+ PropertyWindow.cs
+
+
+ ToolboxWindow.cs
+
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Smart.FormDesigner.Demo.sln b/Smart.FormDesigner.Demo.sln
new file mode 100644
index 0000000..bd376c4
--- /dev/null
+++ b/Smart.FormDesigner.Demo.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28010.2036
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Smart.FormDesigner.Demo", "Smart.FormDesigner.Demo.csproj", "{F0C044E1-0530-424E-BE99-D182C9F5DE99}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {F0C044E1-0530-424E-BE99-D182C9F5DE99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F0C044E1-0530-424E-BE99-D182C9F5DE99}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F0C044E1-0530-424E-BE99-D182C9F5DE99}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F0C044E1-0530-424E-BE99-D182C9F5DE99}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {D7F8BA1B-659E-4E01-BE4F-CA4CB452875D}
+ EndGlobalSection
+EndGlobal
diff --git a/ToolboxWindow.Designer.cs b/ToolboxWindow.Designer.cs
new file mode 100644
index 0000000..0d3951b
--- /dev/null
+++ b/ToolboxWindow.Designer.cs
@@ -0,0 +1,60 @@
+namespace Smart.FormDesigner.Demo
+{
+ partial class ToolboxWindow
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.Toolbox = new Smart.FormDesigner.ToolboxControl();
+ this.SuspendLayout();
+ //
+ // Toolbox
+ //
+ this.Toolbox.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
+ this.Toolbox.Designer = null;
+ this.Toolbox.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.Toolbox.Location = new System.Drawing.Point(0, 0);
+ this.Toolbox.Name = "Toolbox";
+ this.Toolbox.Size = new System.Drawing.Size(184, 461);
+ this.Toolbox.TabIndex = 0;
+ //
+ // ToolboxWindow
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(184, 461);
+ this.Controls.Add(this.Toolbox);
+ this.Name = "ToolboxWindow";
+ this.Text = "工具箱";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ internal ToolboxControl Toolbox;
+ }
+}
\ No newline at end of file
diff --git a/ToolboxWindow.cs b/ToolboxWindow.cs
new file mode 100644
index 0000000..4e30712
--- /dev/null
+++ b/ToolboxWindow.cs
@@ -0,0 +1,68 @@
+using System.ComponentModel;
+using System.Windows.Forms;
+using WeifenLuo.WinFormsUI.Docking;
+
+namespace Smart.FormDesigner.Demo
+{
+ public partial class ToolboxWindow : DockContent
+ {
+ public ToolboxWindow()
+ {
+ InitializeComponent();
+ InitToolbox();
+ }
+
+ private void InitToolbox()
+ {
+ string groupName = "公共控件";
+ this.Toolbox.AddToolboxItem(typeof(Button), groupName);
+ this.Toolbox.AddToolboxItem(typeof(CheckBox), groupName);
+ this.Toolbox.AddToolboxItem(typeof(CheckedListBox), groupName);
+ this.Toolbox.AddToolboxItem(typeof(ComboBox), groupName);
+ this.Toolbox.AddToolboxItem(typeof(DateTimePicker), groupName);
+ this.Toolbox.AddToolboxItem(typeof(Label), groupName);
+ this.Toolbox.AddToolboxItem(typeof(LinkLabel), groupName);
+ this.Toolbox.AddToolboxItem(typeof(ListBox), groupName);
+ this.Toolbox.AddToolboxItem(typeof(ListView), groupName);
+ this.Toolbox.AddToolboxItem(typeof(MaskedTextBox), groupName);
+ this.Toolbox.AddToolboxItem(typeof(MonthCalendar), groupName);
+ this.Toolbox.AddToolboxItem(typeof(NotifyIcon), groupName);
+ this.Toolbox.AddToolboxItem(typeof(NumericUpDown), groupName);
+ this.Toolbox.AddToolboxItem(typeof(PictureBox), groupName);
+ this.Toolbox.AddToolboxItem(typeof(ProgressBar), groupName);
+ this.Toolbox.AddToolboxItem(typeof(RadioButton), groupName);
+ this.Toolbox.AddToolboxItem(typeof(RichTextBox), groupName);
+ this.Toolbox.AddToolboxItem(typeof(TextBox), groupName);
+ this.Toolbox.AddToolboxItem(typeof(ToolTip), groupName);
+ this.Toolbox.AddToolboxItem(typeof(TreeView), groupName);
+ this.Toolbox.AddToolboxItem(typeof(WebBrowser), groupName);
+
+ groupName = "容器";
+ this.Toolbox.AddToolboxItem(typeof(FlowLayoutPanel), groupName);
+ this.Toolbox.AddToolboxItem(typeof(GroupBox), groupName);
+ this.Toolbox.AddToolboxItem(typeof(Panel), groupName);
+ this.Toolbox.AddToolboxItem(typeof(SplitContainer), groupName);
+ this.Toolbox.AddToolboxItem(typeof(TabControl), groupName);
+ this.Toolbox.AddToolboxItem(typeof(TableLayoutPanel), groupName);
+
+
+ groupName = "菜单和工具栏";
+ this.Toolbox.AddToolboxItem(typeof(ContextMenuStrip), groupName);
+ this.Toolbox.AddToolboxItem(typeof(MenuStrip), groupName);
+ this.Toolbox.AddToolboxItem(typeof(StatusStrip), groupName);
+ this.Toolbox.AddToolboxItem(typeof(ToolStrip), groupName);
+ this.Toolbox.AddToolboxItem(typeof(ToolStripContainer), groupName);
+
+ groupName = "数据";
+ this.Toolbox.AddToolboxItem(typeof(BindingNavigator), groupName);
+ this.Toolbox.AddToolboxItem(typeof(BindingSource), groupName);
+ this.Toolbox.AddToolboxItem(typeof(DataGridView), groupName);
+
+ groupName = "组件";
+ this.Toolbox.AddToolboxItem(typeof(BackgroundWorker), groupName);
+ this.Toolbox.AddToolboxItem(typeof(ErrorProvider), groupName);
+ this.Toolbox.AddToolboxItem(typeof(Timer), groupName);
+
+ }
+ }
+}
diff --git a/ToolboxWindow.resx b/ToolboxWindow.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/ToolboxWindow.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/app.config b/app.config
new file mode 100644
index 0000000..2a0024f
--- /dev/null
+++ b/app.config
@@ -0,0 +1,3 @@
+
+
+
diff --git a/images/align_bottom_16x.png b/images/align_bottom_16x.png
new file mode 100644
index 0000000..11ed1f9
Binary files /dev/null and b/images/align_bottom_16x.png differ
diff --git a/images/align_bottom_on_16x16.png b/images/align_bottom_on_16x16.png
new file mode 100644
index 0000000..11ed1f9
Binary files /dev/null and b/images/align_bottom_on_16x16.png differ
diff --git a/images/align_center_16x.png b/images/align_center_16x.png
new file mode 100644
index 0000000..a0a37f9
Binary files /dev/null and b/images/align_center_16x.png differ
diff --git a/images/align_left_16x.png b/images/align_left_16x.png
new file mode 100644
index 0000000..124af2b
Binary files /dev/null and b/images/align_left_16x.png differ
diff --git a/images/align_middlle_16x.png b/images/align_middlle_16x.png
new file mode 100644
index 0000000..d4dd662
Binary files /dev/null and b/images/align_middlle_16x.png differ
diff --git a/images/align_right_16x.png b/images/align_right_16x.png
new file mode 100644
index 0000000..431154d
Binary files /dev/null and b/images/align_right_16x.png differ
diff --git a/images/align_toGrid_16x.png b/images/align_toGrid_16x.png
new file mode 100644
index 0000000..6acb7d3
Binary files /dev/null and b/images/align_toGrid_16x.png differ
diff --git a/images/align_top_16x.png b/images/align_top_16x.png
new file mode 100644
index 0000000..bc2de80
Binary files /dev/null and b/images/align_top_16x.png differ
diff --git a/images/copy_16x.png b/images/copy_16x.png
new file mode 100644
index 0000000..5e506e8
Binary files /dev/null and b/images/copy_16x.png differ
diff --git a/images/cut_16x.png b/images/cut_16x.png
new file mode 100644
index 0000000..6683ee7
Binary files /dev/null and b/images/cut_16x.png differ
diff --git a/images/delete_16x.png b/images/delete_16x.png
new file mode 100644
index 0000000..4b6d6d4
Binary files /dev/null and b/images/delete_16x.png differ
diff --git a/images/demo1.png b/images/demo1.png
new file mode 100644
index 0000000..09244ca
Binary files /dev/null and b/images/demo1.png differ
diff --git a/images/new_form_16x.png b/images/new_form_16x.png
new file mode 100644
index 0000000..0d72138
Binary files /dev/null and b/images/new_form_16x.png differ
diff --git a/images/open_file_16x.png b/images/open_file_16x.png
new file mode 100644
index 0000000..8b34c6c
Binary files /dev/null and b/images/open_file_16x.png differ
diff --git a/images/preview_16x.png b/images/preview_16x.png
new file mode 100644
index 0000000..ea95c86
Binary files /dev/null and b/images/preview_16x.png differ
diff --git a/images/redo_16x.png b/images/redo_16x.png
new file mode 100644
index 0000000..8d748fe
Binary files /dev/null and b/images/redo_16x.png differ
diff --git a/images/same_height_16x.png b/images/same_height_16x.png
new file mode 100644
index 0000000..eeec105
Binary files /dev/null and b/images/same_height_16x.png differ
diff --git a/images/same_size_16x.png b/images/same_size_16x.png
new file mode 100644
index 0000000..b7d4086
Binary files /dev/null and b/images/same_size_16x.png differ
diff --git a/images/same_width_16x.png b/images/same_width_16x.png
new file mode 100644
index 0000000..201be4c
Binary files /dev/null and b/images/same_width_16x.png differ
diff --git a/images/save_16x.png b/images/save_16x.png
new file mode 100644
index 0000000..ba5776c
Binary files /dev/null and b/images/save_16x.png differ
diff --git a/images/save_all_16x.png b/images/save_all_16x.png
new file mode 100644
index 0000000..4b16b07
Binary files /dev/null and b/images/save_all_16x.png differ
diff --git a/images/undo_16x.png b/images/undo_16x.png
new file mode 100644
index 0000000..c1341dc
Binary files /dev/null and b/images/undo_16x.png differ
diff --git a/packages.config b/packages.config
new file mode 100644
index 0000000..10647cc
--- /dev/null
+++ b/packages.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sunlight_logo.ico b/sunlight_logo.ico
new file mode 100644
index 0000000..2fe6131
Binary files /dev/null and b/sunlight_logo.ico differ