windows-forms-designer

C# win form custom control - disable selection box, and use font color for selection indicator.

I have a custom control based on the label control. My question is how I disable the selection box around this custom control when a user selects it while in design mode. I would like to just change the font color when selected, and then change it back when unselected. The reason for this is because when you have many labels with small...

TypeLoadException occurred when drag-and-drop a User Control into VS Designer

I created a customized ListView class, BinableListView, which inherits from ListView. I was able to drag and drop the custom ListView into a Form in the designer window. Now, I am trying to add the custom ListView in another User Control first, and add that User Control into the form. However, VS displayed TypeLoadException when I drag a...

Label and Progress bar

Hi everyone, My application is a C# Windows form application. When the user presses the button "Generate" my application creates a new thread and run the new process the process goes something like this pseudo code below Loop counter = 1 to N progressbar = counter/N Display msg on label1 Do some tasks Loop progressbar = 10...

Is there a list of controls placed on the current form in Visual Studio 2005?

Simple situation, really. Using the form designer in VS2005, I placed a label on my form, and then deleted it's text. Now there's no way I can find to select the label. I assume it wasn't deleted; where can I find it? ...

Windows Form Designer Always set CultureInfo to "en-SG", how to change that?

In one of my third party controls, it makes use of an instance of System.Globalization.CultureInfo. So, what happens is an instance of System.Globalization.CultureInfo will be created inside the InitializeComponent form method whenever the Windows Form designer is invoked. The problem is that the cultureInfo instance is always set to e...

Can I change the default modifier from Friend to Private in the Windows Forms designer in VS 2008?

When I develop a Windows Forms app in Visual Studio using C#, every control that I add to my form is by default marked as private, which is what I want. When using VB.NET, every control is by default marked as Friend (the equivalent of internal in C#), which is not what I want. Can I just change this default? It seems like surely it's ...

StandardCommands does not work on non-standard control in windows form designer

Hi I need standard command like copy/paste for non-standard control like LineShape (VisualBasic PowerPack Shapes) in custom form designer Some problem: 1- can't drag drop on form. (but i find way to add it to form by doubleClick or Enter) 2- Copy/Paste does not work.(important) 3- ShowContextMenu does not work. (not important) I kn...

Custom user controls - how to add Code Collection Editor of type Dictionary<int, Color>

Hey there, I am fairly familiar with creating simple custom controls, but I haven't had this instance come up before, I wish to give design time changeability support to a "Colors" dictionary which applies a series of gradients to a custom control panel. Although using a simple public Dictionary<int, Color> ProgressValueColors does in ...

Adding a user control using Windows Form designer

This is probably an incredibly obvious question, but I just can't figure it out. I have a Windows Form managed by the form designer. I'd like to include a custom user control, also managed by the form designer. But I'm unable to get the custom control to show up in the Toolbox, even if I try manually adding it under the "Choose Items......

How to show a hierarchy of browsable properties in designer?

I am writing a windows forms UserControl and want to show a tree of properties for it in the designer. I have seen some controls that do this. For one control example, the "Appearance" property is a node that opens up to a set of properties, and also contains an "Options" node that opens to show even more properties. So far all I can get...

How to Inherit from WebBrowser control in x64? Designer Error

I'm having an issue with an application made in Visual Studio 2k5, and we're taking it to 2k8 and 64-bit compilation. It compiles fine, and works fine, but the designer doesn't like us. Whenever I try and start the designer up on the main form of the application, I get this error: Could not find type 'MyNameSpace.MyWebInherited'. Plea...

Overriding the Windows (Form) control TableLayoutPanel questions

Hi, I have a class which derived from the TableLayoutPanel. This class makeup the tabel corrects (grid 3x8) and add some checkboxes in some cells. All this is done by overriding the function InitLayout(). public class TableLayoutPanelHours : TableLayoutPanel { protected override void InitLayout() { RowCount = 3; ...

Dispose of a .NET application before Application.Run is complete

I have a project that shows a UI when no proper command line arguments are passed. It's is a simple utility built to dynamically update a desktop wallpaper. When it's done with its update I call this.Dispose(); but this causes an issue if command line arguments are passed. The form actually ends up getting the Dispose method call bef...

how to use special characters in windows forms application/report

I need to use a special character (an exponent of two, aka ^2) in a windows forms application. I also need to use it in a Microsoft Report that is opened by this same windows forms application. Anyone know how to do this? ...

How do I debug Windows Forms Designer crashing?

I have a windows forms project. It has a main form derived from System::Windows::Forms::Form which I can open in designer without any problems. If I try and close designer though, it kills Visual Studio (v2008 with SP1). The form includes a tab control which has pages with various System::Windows::Forms::UserControl derived forms. So I'...

How do I get the Windows Forms Designer to use resources from external assembly?

I have some resources (images in this case) in a resource file that I use on controls in my Windows Forms project. The Visual Studio Resource Selection dialog doesn't have very good support for choosing images from resource files unless they're in specific locations, but you can edit the designer file directly, and this works just fine; ...

Visual Studio Windows Forms designer fails with custom .NET component

I'm working on a project in C++/CLI, which includes some custom-made native libraries, a pair of custom .NET components and many .NET application with Windows Forms. Right now, I have problem with the Visual Studio designer; each time I add one of our custom components into a form it works, but after closing the designer tab it fails to...

Problem when creating C# derived components on Visual C# 2010 Express

I used to create components by writing a derived class from some other component (like WebBrowser, for example), and then after successfully running my application the component would appear in the Toolbox as a normal component that I can drag and drop in my forms. After installing Windows 7 and reloading my old solution, even though I...

Designer does not generate code for a property of a subcontrol. Why?

I created SubCtrl inheriting UserControl. It has no code. I created then Ctrl, which also inherits UserControl. It has a SubCtrl in it and its only code means to expose it publicly so it appears in the property list of Ctrl: public subctrl.SubCtrl SUBCTRL { get { return this.subCtrl1; } } Then I created a simple Form project which...

Is there a way to detect if the user is editing a property in a property grid?

I have a Windows form (.NET 3.5) that contains a propertygrid control. The propertygrid control gets refreshed periodically do display any changes that may have occurred in the class which it represents. I want the refresh to only occur if the user is not currently editing a property in the grid. Is there a way to detect if the user is c...