Category: Windows Forms

How to prevent Visual Studio from showing source code instead of the rendered form when there is an error in a .designer.cs file

It is simple, all you need to do is add a single registry key, see: https://stackoverflow.com/questions/2537076/visual-studio-winform-designer-shows-design-errors-as-text-rather-than-html . It happens with both IE8 and IE9. If you don’t feel like editing it, you can use my registry export: 👻 The page moved away and left no forwarding address.

Read More How to prevent Visual Studio from showing source code instead of the rendered form when there is an error in a .designer.cs file

Basics: How to Draw on a Control Using GDI

The comments are in English, and they are perfectly clear: C#//These attributes do not need to be here, it works just as well without them [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.LinkDemand, Flags = System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); // Get handle to device context. IntPtr hdc = e.Graphics.GetHdc(); // Create new graphics object using handle to device …

Read More Basics: How to Draw on a Control Using GDI

What is the difference between ToolStripSplitButton and ToolStripDropDownButton?

It is very simple: both controls are very similar, but the key difference is in how the user works with them – with ToolStripSplitButton you can either click the button itself, which runs whatever action you assign to it, or click the little arrow, which opens the menu. With ToolStripDropDownButton, on the other hand, clicking …

Read More What is the difference between ToolStripSplitButton and ToolStripDropDownButton?