propertygrid

Creating / Modifying Enums at Runtime

帅比萌擦擦* 提交于 2019-12-05 23:42:06
问题 I'm creating a program where the user has the option of creating their own custom properties that will ultimately be displayed in a PropertyGrid . Right now I don't want to mess with custom editors, so I'm only allowing primitive type properties ( string , int , double , DateTime , bool etc.) that the PropertyGrid already has built in editors for. However, I also want to give the user the option to create multiple choice properties where they can defined a list of possible values which in

Displaying a Collection in a PropertyGrid Control

旧时模样 提交于 2019-12-05 17:59:12
I have an array of objects containing pairs of string labels and values, how would I put them all in a single property grid? public class stringVariable { public String name; public String defaultValue; public String value; }; public List<stringVariable> variables = new List<stringVariable>(); Adding an array of objects to a property grid is pretty well covered in a number of tutorials. This should be what you're looking for. Its not entirely straight forward, but possible. You need to have a class that implements ICustomTypeDescriptor, which will tell you what properties to display, etc.

Is there a better StringCollection editor for use in PropertyGrids?

爱⌒轻易说出口 提交于 2019-12-05 14:15:34
I'm making heavy use of PropertySheets in my application framework's configuration editor. I like them a lot because it's pretty easy to work with them (once you learn how) and make the editing bulletproof. One of the things that I'm storing in my configuration are Python scripts. It's possible to edit a Python script in a StringCollection editor, which is what I've been using, but there's a long distance between "possible" and "useable." I'd like to have an editor that actually supported resizeable and monospace fonts, preserved blank lines, and - hey, let's go crazy with the wishlist - did

Passing objects to a UITypeEditor

霸气de小男生 提交于 2019-12-05 08:40:01
I am currently hoping to use a PropertyGrid to allow users to edit some of my classes, however I've hit a wall with passing objects to the UITypeEditor(s) they use. When the user presses the drop down I want to show a listbox of already loaded textures to choose from, if they want to use a texture the application hasn't loaded yet they can click a button to choose one from a file dialog. In case I make no sense here a mock of the form: . My problem: To fill the listbox I need access to the class that manages the list of resources from the UITypeEditor. Now I've solved this problem for my own

Using custom color picker dialog in PropertyGrid

耗尽温柔 提交于 2019-12-05 06:14:57
问题 In PropertyGrid default color picker dialog not allow to set alpha value of color. I already made my own color picker dialog and want to use it in PropertyGrid but not sure how to do it. 回答1: I managed to use my custom color picker dialog in property grid and copying code of it here in case some need it too: using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; using System.Windows.Forms.Design; namespace HelpersLib { public

PropertyGrid - Possible to have a file/directory selection button next to a property value?

一个人想着一个人 提交于 2019-12-05 03:54:54
Is it possible to have a file/directory selection button next to a property value in the PropertyGrid? Hitting the button would launch a standard "Open File" or "Select Directory" type of dialog. In a perfect world, this could be done using an Attribute on the SelectedObject's property. Yes, add this attribute to the property. [EditorAttribute(typeof(FileNameEditor), typeof(UITypeEditor))] 来源: https://stackoverflow.com/questions/3656345/propertygrid-possible-to-have-a-file-directory-selection-button-next-to-a-prop

Can you/How to specify Editor at runtime for PropertyGrid (for PCL)?

别来无恙 提交于 2019-12-04 19:14:37
I wrote a PCL with custom objects in there, and then I create a GUI that handles the objects from the PCL... and I try to use PropertyGrid to edit the properties... I've already read that in order for the grid to know what to do with the object, I need to specify the EditorAttribute as well as providing a TypeConverter... but I don't think I could add those 2 in the PCL... Is there a way to handle this at the GUI level, like telling the PropertyGrid to use a specific type of Editor/TypeConverter at runtime? I went through the list of available function/properties of the grid and doesn't look

Limitations of using .NET 2.0 (Windows Forms) controls in WPF?

↘锁芯ラ 提交于 2019-12-04 08:09:34
I want to start a new application on WPF . The new User interface in WPF needs DataGridView control and PropertyGrid Control. But it looks like that these two controls won't exist in WPF and I want to host these two controls using WindowsFormsHost . However, if I do that, is there any limitation anybody forsee with this approach? Ray Burns The main limitation is that you loose all the powerful features of WPF: Data binding , ControlTemplates and DataTemplates , Infinite sizing, Zooms/Rotations, Opacity , Attached Properties , just to name a few. That's a lot to give up! You'll have to program

How to relabel ellipsis button for modal UITypeEditor in PropertyGrid?

人走茶凉 提交于 2019-12-04 04:10:05
问题 I have a Windows forms PropertyGrid and a customer UITypeEditor per http://msdn.microsoft.com/en-us/library/system.drawing.design.uitypeeditoreditstyle.aspx Displays an ellipsis (...) button to start a modal dialog box, which requires user input before continuing a program, or a modeless dialog box, which stays on the screen and is available for use at any time but permits other user activities. That ellipsis button is pretty small. How can I relabel it with a more helpful label? 回答1: Long

Using Xceed PropertyGrid

流过昼夜 提交于 2019-12-04 03:54:35
I am a beginner at C#/WPF and am trying to use the Xceed PropertyGrid. On their site they show an example: <xctk:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10" AutoGenerateProperties="False"> <!-- Only the following properties will be displayed in the PropertyGrid --> <xctk:PropertyGrid.PropertyDefinitions> <xctk:PropertyDefinition Name="FirstName" /> <xctk:PropertyDefinition Name="FavoriteColor" /> <xctk:PropertyDefinition Name="PetNames" /> </xctk:PropertyGrid.PropertyDefinitions> </xctk:PropertyGrid> Which I have plugged in to my xaml. I see the PropertyGrid View however I do