the pop-up position of the form can be specified by the property startposition, with the default values:
Manural custom, specified by the attribute location;
Centerscreen Screen Center;
Windowsdefaultbounds system default location (but size is system default form size)
WindowsDefaultLocation system default location (size specified by property size)
Centerparent Parent Form Center
If the custom form displays a location, the property startposition selects Manural and then specifies the coordinate value of the property location.
Specify the code for where the form displays:
this. StartPosition = System.Windows.Forms.FormStartPosition.Manural;
thisnewSystem.Drawing.Point(100,100);
The implementation form appears in the lower-right corner of the screen:
Often see some software in the bottom right corner of the screen pop-up message window, with the following code can be easily implemented:
PublicForm1 () {InitializeComponent ();
This. StartPosition = System.Windows.Forms.FormStartPosition.Manural;
//Gets the current workspace width and height (the workspace does not contain a status bar) intScreenWidth =Screen.PrimaryScreen.WorkingArea.Width; intScreenHeight =Screen.PrimaryScreen.WorkingArea.Height; //calculates the coordinate values displayed by the form and can fine-tune several pixels as needed intx = ScreenWidth- This. Width-5; inty = screenheight- This. Height-5;
This. Location =NewPoint (x, y);}
Operation Result:
Source: http://www.cnblogs.com/libaoheng/archive/2011/07/20/2112032.html