创建一个GUI界面创建一个、界面、GUI

2023-09-04 01:00:46 作者:没有公主命要有女王心。

我已经创建一个 GUI 让用户有机会选择一些控制的想法(文本框,GridView控件,标签等的),并将其放置在一个托盘/板/窗口创建控件的观点,即,pressing保存,这将节省的X,Y,所有控件(包括托盘/板/窗口本身)到XML的W和H(供以后显示在窗口的形式,无论是在一个WebForm)

I've an idea of creating a GUI to give the user the opportunity to select some controls (textbox, gridview, labels, etc) and place it in a pallet/panel/window creating a view of the controls, that, pressing Save, it will save the X, Y, W and H of all controls (including the pallet/panel/window itself) to an XML (for later show in a Window form, either in a WebForm)

我只想问了前进的方向就如何做到这一点。

I just wanna ask the road to take on how to do this.

Kind'a Visual Studio中,但要简单得多。

Kind'a Visual Studio, but MUCH simpler.

我不知道如何开始编码这一点。

I have no idea how to start coding this.

感谢您的任何提示

推荐答案

单向

下面是微软朝着实现自定义窗体设计器,如果你想要做一个code样品'适当'的方式

Here is a code sample from Microsoft towards implementing a custom Forms designer, if you want to do it 'proper' way

http://support.microsoft.com/?id=813808

在创建自定义的MSDN文章构成的设计师

An MSDN article on creating custom forms designers

http://msdn2.microsoft.com/magazine/ad160d36- 48ab-4644-9663-acc4f9cba999

另外,如果你需要的不仅仅是裸骨功能,SharpDevelop的具有良好的视觉形式设计实现,它是开源的,所以你应该能够重复使用通过一些调整。

Also, If you want more than just bare bone functionality, Sharpdevelop has a good visual form designer implementation, it is open source, so you should be able to re-use by making some tweaks.

另一种方法

去与DSL工具。安装Microsoft Visual SDK,创建DSL包,并使用DSL工作台创建你需要的型号符号。

Go with DSL tools. Install Microsoft Visual SDK, create a DSL package, and use the DSL work bench to create the model notations you need.

然后使用文本模板生成XML。这是怎么回事,如果你知道如何使用DSL工具的工作是很容易的,但功能可能会受到限制。

Then use text templates to generate the XML. This is going to be very easy if you know how to work with DSL tools, but the functionality might be limited.