How to avoid error “Constructor on type ‘MyType’ not found” when inheriting a base class

That is completely impossible. The form you see in the design view is an actual instance of your base class. If there is not default constructor, the designer cannot create that instance. You can mark the constructor with the [Obsolete(“Designer only”, true)], and make it throw an exception if called when not in the designer, … Read more

Baseline snaplines in custom Winforms controls

As an update to the Miral’s answer.. here are a few of the “missing steps”, for someone new that’s looking how to do this. 🙂 The C# code above is almost ‘drop-in’ ready, with the exception of changing a few of the values to reference the UserControl that will be modified. Possible References Needed: System.Design … Read more

Disable designer in Visual Studio?

Add a [System.ComponentModel.DesignerCategory(“”)] attribute before a UI class to avoid designer activation on double-click. Note that including System.ComponentModel at the top of the file and then just adding the attribute as [DesignerCategory(“”)] will not work (at least not in Visual Studio 2010/2013). You must use the full, namespace-qualified attribute type name.

Reportviewer tool missing in visual studio 2017 RC

** Update**: 11/19/2019 Microsoft has released a new version of the control 150.1400.0 in their Nuget library. My short testing shows that it works again in the forms designer where 150.1357.0 and 150.1358.0 did not. This includes being able to resize and modify the ReportViewer Tasks on the control itself. ** Update**: 8/18/2019 Removing the … Read more

Zooming in the visual studio form designer

The Windows Forms designer doesn’t zoom. The WPF one does because it’s vector based, but WinForms is pixel based you don’t get the zooming. If you’ve got multiple monitors you can drag the designer to a second screen and work with it that way, or you can press Alt+Shift+Enter to toggle full screen and work … Read more

Generic base class for WinForm UserControl

We’re doing the same thing and we work around by specializing a class first and derive from the specialized class. Using the code from your example this means something like: public partial class UserControl : UserControlDesignable { … } public class UserControlDesignable : BaseUserControl<Someclass> { } The designer is still acting flaky sometimes – but … Read more

Windows Form Designer: Could not load file or assembly

We have same problem. Some Form/UserControl classes can not be viewed in designer and Visual Studio causes various exceptions. There are one typical cause: One of designed component thrown unhandled exception during initialization ( in constructor or in Load event or before ). Not only for this case, you can run another instance of visual … Read more

How can I get Visual Studio 2008 Windows Forms designer to render a Form that implements an abstract base class?

I KNEW there had to be a way to do this (and I found a way to do this cleanly). Sheng’s solution is exactly what I came up with as a temporary workaround but after a friend pointed out that the Form class eventually inherited from an abstract class, we SHOULD be able to get … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)