1. System API Processing
Separate the desktop and mobile APIs
2, a code, two projects, compiled separately
When you add an existing file, use the Add link instead of adding the attached
3, the desktop form appears irregular, style is not uniform problem
First, add two member variables to a form class member
publicForm parentform; Privatebool inited; |
Then add the following code
public ctor (Form parent) : This () { ParentForm = parent; }
protectedoverridevoid onclosing (CancelEventArgs e) { if (parentform! = null) { parentform.location = This . Location; Parentform.show (); } base. OnClosing (e); }
protectedoverridevoid OnActivated (EventArgs e) { if (!inited) { inited = true ; Parentform.hide (); } base. OnActivated (e); }
protectedoverridevoid OnLoad (EventArgs e) { if (parentform! = null) { if (environment. Osversion.platform = = platformid. WinCE) { this. FormBorderStyle = formborderstyle. None; this. ControlBox = false; } Else { bool tmp = this. Visible; this. Visible = false; this. FormBorderStyle = formborderstyle. FixedSingle; this. ControlBox = true; this. MaximizeBox = false; this. MinimizeBox = true; this. Visible = tmp; } this. location = parentform.location; this. Size = parentform.size; } base. OnLoad (e); }
|
Use the form class with a construct with the form parent argument
Summary of Wince\window Mobile program desktop