简体   繁体   English

在C#中模仿Visual Studio“属性”选项卡

[英]Mimicking Visual Studio “Properties” Tab in C#

I'm creating a simple WYSIWYG editor for HTML in C#, and I want to implement a simple group of controls to view and manipulate the various properties of HTML form elements. 我正在用C#为HTML创建一个简单的WYSIWYG编辑器,我想实现一组简单的控件来查看和操作HTML表单元素的各种属性。 I envision the properties panel to look like the one in Visual Studio: 我设想属性面板看起来像Visual Studio中的那个:

视觉工作室中属性框的图片

Such that when the user clicks on an HTML element they've added they can change the text, class, id, etc. of the element. 这样,当用户点击他们添加的HTML元素时,他们可以更改元素的文本,类,id等。 The problem is, I can't find how to make a panel that looks like this using C#. 问题是,我找不到如何使用C#创建一个看起来像这样的面板。 Obviously I know how to implement the dropdown list and the buttons, but the main body that actually contains the properties is like a slick version of a tree-view that I don't even know where to begin coding. 显然我知道如何实现下拉列表和按钮,但实际包含属性的主体就像一个光滑的树视图版本,我甚至不知道从哪里开始编码。

I'm not looking for someone to code this whole thing for me, but it would be great if somebody could point me to a form control that looks like the tree-view. 我不是在寻找有人为我编写这一切的代码,但如果有人能指出我看起来像树视图的表单控件那就太棒了。 I have tried googling around for answers but haven't had any luck. 我试过谷歌搜索答案,但没有运气。 I have also tried looking at the open source project Sharp Develop which uses a similar control, but I've had considerable trouble wading through the hundreds of files of code to find the specific part of the GUI I'm focused on. 我也尝试过使用类似控件的开源项目Sharp Develop ,但是我在使用数百个代码文件时遇到了相当大的麻烦,以找到我关注的GUI的特定部分。

Any help on this would be greatly appreciated. 任何有关这方面的帮助将不胜感激。 Sorry if I was a tad bit vauge above, I guess what I'm really looking for is a nice form control or set of controls in C# to mimick the main body of the properties window. 对不起,如果我上面有点vauge,我想我真正想要的是一个很好的表单控件或C#中的一组控件来模仿属性窗口的主体。 I've tried to be as thorough as possible, but if you have any questions leave a comment and I'll try to improve my question. 我试图尽可能彻底,但如果你有任何问题留下评论,我会尽力改善我的问题。

The body of that panel contains a PropertyGrid control, which you can use yourself. 该面板的主体包含一个PropertyGrid控件,您可以自己使用它。 It's not in the Toolbox by default but you can add it. 默认情况下它不在工具箱中,但您可以添加它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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