uitypeeditor

How do I make a property of a custom control open a file dialog?

喜你入骨 提交于 2020-08-20 11:38:13
问题 I have a custom control with a property that holds the name (full path) to a file location that exists on the target computer. The exact path will vary according to type of target pc and is typically set right after I add the custom control to my Form, while I am still in design mode of my project, so that when my application runs, it picks up the filename from the property. It would be convenient if the property opened a file dialog to let me browse to the location (similar to how dialogs

How do I make a property of a custom control open a file dialog?

社会主义新天地 提交于 2020-08-20 11:36:48
问题 I have a custom control with a property that holds the name (full path) to a file location that exists on the target computer. The exact path will vary according to type of target pc and is typically set right after I add the custom control to my Form, while I am still in design mode of my project, so that when my application runs, it picks up the filename from the property. It would be convenient if the property opened a file dialog to let me browse to the location (similar to how dialogs

Design-time editor support for controls collection

邮差的信 提交于 2019-12-30 02:29:24
问题 I'd like to add a property which represents a collection of controls to a component and have a collection editor with which I can easily select the controls that belong to the collection. VS does almost what I want automatically with the following code: Private _controls As New List(Of Control) <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _ Public ReadOnly Property SelectedControls() As List(Of Control) Get Return _controls End Get End Property I get the default

How to relabel ellipsis button for modal UITypeEditor in PropertyGrid?

依然范特西╮ 提交于 2019-12-25 01:44:57
问题 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

How WinForms PropertyGrid finds custom type converters in external libraries?

核能气质少年 提交于 2019-12-25 01:13:44
问题 We have a custom control. Some properties of this control use custom type converters and UI type editors, and they are implemented in a separate design-time DLL. These type converters are defined using the string syntax of the TypeConverter and Editor attributes, for example: [TypeConverter("<full class name>, <library name>, Version=<version>")] public CustomType Property1 { // property implementation } When we display the properties of our custom control in the standard PropertyGrid control

C# UITypeEditor with Parameter

时间秒杀一切 提交于 2019-12-22 19:01:33
问题 I have created a custom UITypeEditor which launches a form (StringSelector) to display a list of strings which the user choses from. The problem is that this form needs to know what StringManager to use (stringmanage is simply a class which contains all the strings allowed in a List). When I created this form I was passing in the StringManager as a parameter in the Constructor, but I cannot work out how i can do this with the UITypeEditor. Below is my current code which uses a constructor

How do you hook an editor for TFS 2010 WF BuildProcessTemplate arguments for built-in types that have a converter?

一世执手 提交于 2019-12-22 12:34:24
问题 I've followed the Team Foundation Server 2010 book's custom editor for a dictionary<string,string> and can't get it to go. I have another custom editor in the same assembly, and consumed by the same build template that works. This SO hints at it being a TypeConverter issue, but I don't think any part of a custom build assembly is just run when it is loaded. I'm getting the default generic Collection Editor instead of mine. I have tried using code more like my credential UITypeEditor uses, and

How do I inject a custom UITypeEditor for all properties of a closed-source type?

允我心安 提交于 2019-12-17 16:39:06
问题 I want to avoid placing an EditorAttribute on every instance of a certain type that I've written a custom UITypeEditor for. I can't place an EditorAttribute on the type because I can't modify the source. I have a reference to the only PropertyGrid instance that will be used. Can I tell a PropertyGrid instance (or all instances) to use a custom UITypeEditor whenever it encounters a specific type? Here is an MSDN article that provides are starting point on how to do this in .NET 2.0 or greater.

Selecting static fields via dropdown at Designtime in C#

放肆的年华 提交于 2019-12-13 05:18:52
问题 Is it possible to modify a ComponentConverter , Typeconverter ,... so I can select "Components" that are in a static class outside the form? When I create a custom control and add a property of type Component or Control I get a dropdown menu in designer where I can select one ot the existing ones. The reference to the selected object is automatically added in the designer code. Problem is, that the dropdown only lets me select components that were declared in this form or a form that this

Property set isn't being triggered with a UITypeEditor implemented

寵の児 提交于 2019-12-12 10:42:48
问题 I have a property grid that when a button is clicked for one of the properties, certain fields are filled in. However the property's set isn't being triggered. I do not know why. private OptoSigmaSettings dataToGet = new OptoSigmaSettings(); [Editor(typeof(OptoSetupFormEditor), typeof(UITypeEditor))] [TypeConverter(typeof(ExpandableObjectConverter))] [Category("Setup")] public OptoSigmaSettings DataToGet { get { return dataToGet; } set { MessageBox.Show("Im here"); //This isnt happening.