design-time

Using UI Editor at runtime on a button click

若如初见. 提交于 2019-12-13 02:51:01
问题 I have a custom UI Editor for a property in C# . The editor works fine at design time. How ever I want to lauch the editor on click of a button at runtime. How can I do this? Thanks, Datte 回答1: Using a UITypeEditor in custom (i.e. runtime) scenarios is definitely a trick proposition. The most obvious part about launching a UITypeEditor is quite trivial: Just cast the instance to UITypeEditor and call EditValue or whatever other method you want. One of the hardest parts about using them is

How can I avoid properties being reset at design-time in tightly bound user controls?

[亡魂溺海] 提交于 2019-12-12 18:20:34
问题 I have UserControl 'A' with a label, and this property: /// <summary> /// Gets or Sets the text of the control /// </summary> [ Browsable(true), EditorBrowsable(EditorBrowsableState.Always), Category("Appearance") ] public override string Text { get { return uxLabel.Text; } set { uxLabel.Text = value; } } I then have UserControl 'B' which has UserControl 'A' on it, and I set the Text Property to "My Example Label" in the designer. Then, I have my MainForm, which has UserControl 'B' on it.

How to force Visual Studio 2010 to ignore a WPF XAML declared DataContext at design time?

筅森魡賤 提交于 2019-12-12 04:02:54
问题 Quite often I will set up WPF UserControl with a declarative DataContext: <UserControl...> <UserControl.DataContext> <local:SomeModel x:Name="Model" /> </UserControl.DataContext> </UserControl> When in design mode, Visual Studio will attempt to instantiate the DataContext. However, when the DataContext is pulling data from a configuration file, Visual Studio 2010 will throw an error such as: Cannot create an instance of "SomeModel". When the error is thrown, the design time experience is of

Hide User-Control in Design Mode

末鹿安然 提交于 2019-12-12 02:15:57
问题 Controls in my ASP.Net (3.5) pages to simulate popups (Visual-Studio 2008). The problem is that all these popups are positioned over the normal controls in the page in design mode. So my Question is: How can I hide User-Controls in Design-Mode. 回答1: From googling around a bit I don't think you can with an ascx. I think you should turn it into a custom control if you need this. http://www.west-wind.com/WebLog/posts/189.aspx might help edit: http://ajdotnet.wordpress.com/2006/08/28/do-you-value

'Missing' library at design-time in VS2010?

我的梦境 提交于 2019-12-12 01:17:45
问题 I located a really nice open-source docking solution called 'AvalonDock' on codeplex, and downloaded v1.1, and included the dll in a WPF project in VS2010 Beta 2 (targeting .NET 4.0) - so far so good. Then I saw that V1.2 was available and it fixed exactly the issue I was having (V1.2 exposes a DP called DocumentsSource on the DockingManager, so I can keep it cleaner MVVM-wise) So I downloaded the binaries for V1.2.2691, removed the old reference, included the new one and now I cannot for the

Design-time moving of a child control owned by a composite user control

烂漫一生 提交于 2019-12-11 21:31:45
问题 I have a Windows Forms user control, which (for various reasons irrelevant to this issue) are exposed in the designer, much like the panels in a split panel. Most everything works nicely, except for dragging the control. The child controls are created by the user control, and it does not accept new children. The intent is only to allow the properties of the predefined children to be edited. Since the control allows the child controls to be designed, they can also be selected in the designer

Determine at run time if a control allows other controls to be added to it at design time

落花浮王杯 提交于 2019-12-11 18:54:28
问题 I need to manipulate all controls on a form. I'm fine with accessing the Controls collection to do this. The problem comes with trying to include any controls contained within container controls such of GroupBox or Panel . I could recursively iterate the each Control's own Controls collection but this then accesses all constituent controls for non-design time containers. Since my non-container controls all manage their constituent controls' state based on the their own properties I don't to

Get all controls of the current form at design-time

家住魔仙堡 提交于 2019-12-11 07:33:53
问题 I have a question about design-time things: I've made a component with an property "Links". Those links are Controls. Now I want to make a UI-Dialog (for editing this property in the property grid). How can I get all controls of the current form? I think the component has an connection to it, but where? I can't find anything. Thanks :) 回答1: This is quite untrivial to do, I don't know of any examples of .NET components that do this. You can get to the form at design time with the Site property

How to save collection data in Design Time with Custom UITypeEditor C# WindowsFormApplication?

随声附和 提交于 2019-12-11 05:46:21
问题 I wrote my own UITypeEditor and I reached my goal with help of @Sefe and with THIS link. My basic setup: In this setup, BaseForm extends System.Windows.Forms.Form . Here i'm putting my property ( List<Control> ActionButtons ) that have a custom UITypeEditor like a modal style. Resumed workflow (All here are in Design Time): 1 - Open MyForm. 2 - Click at ActionButtons(inherited by BaseForm) ellipsis [...] on MyForm properties panel. 3 - A custom form is opened with inflated objects that I want

Hide ellipsis (…) button of expandable property like “…” button of font property in the property grid

一个人想着一个人 提交于 2019-12-11 04:39:23
问题 I've added a new property to my custom control as expandable property like font property in Property Grid. After using from my custom control in a Windows Forms Application project, I see an ellipsis (…) button like "…" button of font property in Property Grid. (For more information, please see the following picture.) Now, I want to hide the ellipsis (…) button for my new expandable property. Expandable property codes are: [DisplayName("Floors Information")] [Description("Floors