How to get Mouse Position and Cursor information

C#, Component Development, Win Forms No Comments »

If you want to set or retrieve the current mouse position, or turn the cursor on or off, use the static Cursor class.

Point CursorPos = Cursor.Position

How to allow a User Control to accept controls at design time

C#, Component Development No Comments »

if you build a user control and you want to allow design time adding of sub controls to the user control then you need to add a designer attribute to the control definition.
[csharp][Designer("System.Windows.Forms.Design.ParentControlDesigner,System.Design", typeof(System.ComponentModel.Design.IDesigner))]
public partial class MyUserControl : UserControl
{
// control implementation…
}

[/csharp]

WP Theme &Design by minus19.com & Icons
Entries RSS Comments RSS Log in