windows-forms-designer

Remove GenerateMember and Modifiers Properties in Designer

本秂侑毒 提交于 2020-01-10 05:15:17
问题 I created a Button descendant where I hide all the properties I don't use. I do it like this: [Browsable(false)] [Bindable(false)] [EditorBrowsable(EditorBrowsableState.Never)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Obsolete("", true)] public new Boolean AllowDrop { get; set; } Most properties get correctly hidden and cannot be used. However there are two properties that I cannot get rid of. Is there a way to also remove GenerateMember and Modifiers in the

UserControl with header and content - Allow dropping controls in content panel and Prevent dropping controls in header at design time

最后都变了- 提交于 2020-01-09 05:26:05
问题 I wrote User Control (yay!). But I want it to behave as a container. But wait! I know about [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] Trick. The problem is - I don't want all of my control to behave like container, but only one part. One - de facto - panel ;) To give wider context: I wrote a control that has Grid, some common buttons, labels and functionalities. But it also has a part where the user is supposed to drop his custom buttons

Displaying a collection of controls in Windows Forms

不羁岁月 提交于 2020-01-09 03:56:24
问题 I want to display something like the following :- Each row is about a process (information like PID, Parent etc.). User can check the checkbox and click Launch button to get some dynamic details about that process. The problem is that CheckedListBox control doesn't allow more than one columns and other controls like ListView (which allow multiple columns) don't allow controls like checkbox to be embedded in a columns. I want to know if there is a control which will allow me to have a list of

Windows forms editor keeps recreating an event method

岁酱吖の 提交于 2020-01-06 19:28:50
问题 I have a C# application with a custom control. The custom control class looks like this: public partial class DetNumericUpDown : UpDownBase { public event EventHandler ValueChanged; /* some public methods */ public DetNumericUpDown() { /* ... */ } } Then I have several instances of DetNumericUpDown in a form file Main.cs, placed from the designer. Each of these instances have their own ValueChanged event defined, but instead of placing them in Main.cs I have moved them for clarity to another

Windows Forms Designer Custom Control from Label has wrong property value -> designer exception

Deadly 提交于 2020-01-06 17:57:52
问题 I'm actually a bit confused here, I've built a dll with a custom control based on Label with AutoSize fixed as true. I happily used it but the designer created the control with AutoSize still set to true. I changed the dll in an attempt to get the designer to show my control with AutoSize set false and ended up with a thrown exception in the designer. I undid the last change but still got the exception! I couldn't progress until I created a new project from scratch removing all reference to

Windows forms designer NullReferenceException- where to go from here?

夙愿已清 提交于 2020-01-06 12:53:53
问题 When I try to open one of my forms in the designer, it says, "Object reference not set to an instance of an object." It does not provide a way to continue, and it does not give me any clue as to what is causing the error. at Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.System.CodeDom.Compiler.ICodeParser.Parse(TextReader stream) at System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream) at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom

Need To Hide A Designer-Only Property From PropertyGrid For A .NET Winforms Control

你。 提交于 2020-01-05 04:17:37
问题 I am deep into using the Winforms designer (System.ComponentModel.Design namespace) in my C#/.NET solution so that my users have access to a form designer within my running application. Much of it works well, but I ran into a very specific problem: I encountered a property on a Microsoft control that appears only during design-time--i.e., for the design-time instance of the control. I want to suppress that property so that users cannot modify it when they place an instance of that control on

PropertyGrid mult. controls select, null exception on property set?

﹥>﹥吖頭↗ 提交于 2020-01-05 03:33:11
问题 I have a custom object, ComplexName, that I want to show in the propertygrid (in the VS designer, not at runtime). It all seems to work correctly (with the ExpandableObjectConverter implemented), when I have just one control selected. I can set any\all of the attributes the way I want them to (expanded or via the typeconverter). When I select multiple controls though, the issue starts. At first, When you selected multiple objects with the same property (with the same value), I wanted the text

Localizable User Controls

荒凉一梦 提交于 2020-01-04 13:09:09
问题 If I have a form that is localized and has User Controls that are localized, how I can I view the form and the controls in the language specified in the VS Properties? Right now when I change the language, all my controls that are not part a user control adjust appropriately, but my user controls do not. 回答1: You have to localize each user control individually when designing it in the designer. Then you can set the property Localizable on the user control to true and choose your language.

Why does calling Focus() not set focus in this instance?

笑着哭i 提交于 2020-01-04 06:57:10
问题 I adapted a roll-your-own Input box based on this. I modified the code to the following: using System; using System.Windows.Forms; public static class PromptForText { public static string ShowDialog(string caption, string text) { Form prompt = new Form(); prompt.Width = 280; prompt.Height = 150; prompt.Text = caption; Label textLabel = new Label() { Left = 16, Top = 20, Width = 240, Text = text }; TextBox textBox = new TextBox() { Left = 16, Top = 40, Width = 240 }; Button confirmation = new