How to compile a form using .NET Compact Framework code

The .NET Compact Framework does not have the value FormWindowState.Minimize. How can I minimize my application so that it remains active and accessible, but returns focus to the previous application?

+5
source share
4 answers

, windows mobile — - pocketpc 2002, -— X . , , . , ?

+1

Hide() .

0

WinCE (4.2 5.0), , Windows Mobile.

( ), , , ( ), . , , .

, Form.Minimize() .

  • Form.Hide() . P/Invoking ShowWindow(Form.Handle, 6), 6 = SW_MINIMIZE, , , Form.FormBorderStyle = Normal ( None), .
  • Form.WindowState = Normal Maximized , , .

, , . , , .

public class MyForm 
{
  public MyForm()
  {
     InitializeComponent();

     NativeMethods.HideTaskbar();
     FormBorderStyle = FormBorderStyle.FixedSingle;
     WindowState = FormWindowState.Normal;
     Rectangle screenBounds = Screen.PrimaryScreen.Bounds;
     int taskBarHeight = SystemInformation.MenuHeight;
     NativeMethods.MoveWindow(Handle, 
                              0, -taskBarHeight, 
                              screenBounds.Width, screenBounds.Height + taskBarHeight);
  }

  public void HandleMinimize()
  {
    NativeMethods.ShowTaskBar();
    NativeMethods.ShowWindow(Handle, WindowShowStyle.Minimize);
  }

, , , - , .

NativeMethods P/Invoke. coredll http://www.pinvoke.net .

0
source

All Articles