windows-forms-designer

Baseline snaplines in custom Winforms controls

I have a custom user control with a textbox on it and I'd like to expose the baseline (of the text in the textbox) snapline outside of the custom control. I know that you create a designer (inherited from ControlDesigner) and override SnapLines to get access to the snaplines, but I'm wondering how to get the text baseline of a control t...

Visual Studio 2005 - can not open form on designer

My team developed a GUI application on Visual Studio 2005, managed C++. Since some deliveries it is not possible to open the form in the designer, even if the source code and the project settings have not been changed. The designer reports this error: Exception of type 'System.OutOfMemoryException' was thrown. *at Microsoft.VisualStu...

Windows Form Designer: Could not load file or assembly...

Hi all, Has anyone ever had the issue where trying to "View Designer" on a windows form in Visual Studio .NET causes the error: "Could not load file or assembly…" ? In this case, the assembly in question was XYZ.dll. I managed to fix this by adding XYZ.dll and all its references to my project's references (even though my project doesn'...

VS2008 Windows Form Designer does not like my control.

I have a control that is created like so: public partial class MYControl : MyControlBase { public string InnerText { get { return textBox1.Text; } set { textBox1.Text = value; } } public MYControl() { InitializeComponent(); } } partial class MYControl { /// <summary> /// Required de...

C#: Move Controls From Form to tabPage in VS Form Designer

I decided to change a utility I'm working on to use a tabpage. When I tried to drag various controls from the form to a tab page on top of the form, it made copies of the control, giving it a different name. It's easy enough to just remake the form on top of the tab or just edit the source code in the designer to have everything be add...

Collapsible member events in Visual Studio designer

How can I get my control members to show their events on the Visual Studio event grid? Visual Studio does this for certain things like the "(DataBindings)" member by putting them in a collapsible section, like so: I'd like to do this for some of my own components, since their events are usually handled on the form, and having to creat...

VS 2008 Designer not executing default constructor anymore?

Hi, I just tested which type of code is executed by the WinForms Designer in VS 2008. It seems that the designer is not executing the default constructor anymore. I added a simple thing like this.Text = "foo"; nothing is changed in the designer. Did I miss a change between VS 2005/2008? (or SP1) tia ...

How do you deal with exceptions in UserControls constructors when using the .net Winform Designer ?

When you load an UserControl in the WinForm designer, VisualStudio executes the InitializeComponent() method of the control, but not its constructor. This really makes a difference because it's quite common to have some code in the constructor which cannot run at design time. Unfortunately, when you add an UserControl to another control...

Why does C# designer-generated code (like Form1.designer.cs) play havoc with Subversion?

My workshop has recently switched to Subversion from SourceSafe, freeing us from automatic locks. This led to concurrent editing of the Forms, which is wonderful. But when multiple developers commit their changes, the code files created by the designer (all the files named TheFormName.designer.cs) cause conflicts which are very difficult...

How do I get the Localizable property and support in my own design tool?

Overview In another question, I asked about deploying localizations for some runtime compiled UserControl's. However, before I can get to deploying the localizations, I need a way of localizing the controls. Background The controls are created by our own WinForms-style designer (using .NET's support for design surfaces, etc.) and save...

I get errors when viewing forms in the designer - how can i avoid this?

Some of my forms show errors when i load them in the designer. This is because in their constructors they use system settings loaded from a configuration file. When the form is loaded in the designer it uses some random path and unsurprisingly the config file isn't there. eg. The configuration file C:\Documents and Settings\Rory\Local...

How can I get an overridden Text property of my user control to show up in the form designer in VS2005?

I have a user control with the following code in it. [System.ComponentModel.Category("Appearance")] public override string Text { ... } private int myVar; [System.ComponentModel.Category("Appearance")] public int MyProperty { ... } MyProperty shows up in the property grid when the control is inserted in a form, but Text does not. Ho...

Disable designer in Visual Studio?

I'm using Visual C# Express to write Windows Form applications, and call me old school, but I don't like the designer. It is a nuisance and pollutes my project with lots of unwanted files, as well as unwanted monkey-generated source code. Please please please tell me there's a way to turn it off completely. ...

C#: How to use CategoryAttribute.Appearance Property

I have read a bit about Design-Time Attributes for Components. There I found an attribute called CategoryAttribute. On that page it says that The CategoryAttribute class defines the following common categories: And then lists up a number of common categories. One of them are for example Appearance. I thought, brilliant! Then I can...

VS 2005 Can not open DataSet Schema in Designer mode

Hi I cannot view DataSet file in designer mode in VS 2005. When I try to it another solution it is ok but in one of my project solution I cant. The projects are c# class library projects in a solution file. Is there any suggestion? Thanks for your help. ...

Handcode GUI or use gui-designer tool

I would like to hear some opinions on hand coding your GUIs as one typically do when using Java or Qt with C++, vs using a gui-designer tool? Examples of GUI designer tools would be MFC GUI-designer, Qt designer, Interface Builder (Apple). I used to be a fan of hand coding but from recent experience I have switched. The problem I have s...

Localizable User Controls

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. ...

Designer Generated Code in Visual Studio C++/CLI Winforms Project

The Windows Forms Designer in C++/CLI projects generates both the declarations and definitions of all event handlers in the header file itself. The .cpp it generates is a mere stub which simply includes the generated header and stdafx.h. I feel that I could reduce compile times if I moved the implementation (i.e. definition) of all class...

Changing the style of Individual cells in a datagridview row

Is it possible to give individual cells in a data grid view row different styles such as backcolor, fontcolor etc? I do not mean giving the whole row a new style, only a specific cell. ...

How do I tell CodeDomComponentSerializationService not to copy certain property values?

I have a custom WinForms designer, and I've just added functionality to create duplicate components using drag & drop (with the ctrl key held down) by inheriting from CodeDomDesignerLoader. Unfortunately, this works a little too well: the new components get all of the same property values as their originals, and I need some of those to b...