简体   繁体   中英

How can I create my own form designer?

I'm starting my first C# project, and I want to make a "form designer" (like the one in VS).

The idea is, there will be a visual form designer with a limited toolbox, which will generate Python code (later more) to create the same form.

Problem is, I have no idea how to even get started. First of all, I have the form designer in VS: how do I make a "form-within-a-form?"

Next... I have no idea how complicated this is going to be. I suppose I could just make little boxes appear beside each control created on the form when it is clicked, for resizing, and make a textbox appear on it when double clicked or something, to change the text in it... Things like this.

So another thing I would like to know is this:
I do have programming experience in C and C++, I've done PHP for a number of years and am starting with Python as of recently. I've generated forms dynamically in VB6. Given this experience, am I in way over my head with this project?

this looks like a really good place to start. It has a pretty good example to get you started. You can even download his source (registration required).

It sounds like you're aware it's non-trivial for a C# first-timer. If you keep it pretty simple, it sounds like you're heading in the right direction (although a web-based form designer might be easier).

SharpDevelop would be an example of a full-featured IDE that can be re-purposed, but that's way over the top.

Good luck!

For most people starting out in C#, this project would be too much. With your VB6 background, you may be able to pull it off, though.

Here's a hint: the Visual Studio Windows Forms designer draws controls on its surface - by asking the controls to draw themselves.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM