public void DoResize () { int height = Loader.MainWindow.Toolbar.Height - 6; int width = (int)(Loader.MainWindow.Toolbar.Width / 4.85f); Top = 3; Height = height; Width = Math.Min(width, 400); iconPanel.Width = Height - 6; iconPanel.Height = Height - 8; iconPanel.Left = (ClientSize.Width - (iconPanel.Width + 3)); titlePanel.Left = titlePanel.Top = 3; titlePanel.Width = Width - iconPanel.Width - 12; titlePanel.Height = (height / 2); title.Font = Utils.Font.GetHandleFont((titlePanel.Height / 2) - 5); title.Width = titlePanel.Width; version.Left = title.Width; version.Font = Utils.Font.GetHandleFont(Math.Min(title.Font.Size - 3, 12)); version.Top = title.Height - version.Height - (int)(title.Height / 8f); author.Top = title.Height; author.Font = Utils.Font.GetHandleFont(Math.Min(title.Font.Size - 3, 12)); author.Left = (int)(author.Font.Size / 2f); }
private void MainWindow_ResizeEnd (object sender, EventArgs e) { if (!Visible) return; SuspendLayout(); Toolbar.DoResize(); // Code to resize the element ViewManager.GetSelectedView().OnResize(); Toolbar.Invalidate(); // Update it visually Toolbar.Update(); // And update the element ResumeLayout(); }
331321325285873328252833
try { // Registering the window for multi-touch, using the default settings. // p/invoking into user32.dll if (!RegisterTouchWindow(this.Handle, 0)) { Debug.Print("ERROR: Could not register window for multi-touch"); } } catch (Exception exception) { Debug.Print("ERROR: RegisterTouchWindow API not available"); Debug.Print(exception.ToString()); MessageBox.Show("RegisterTouchWindow API not available", "MTScratchpadWMTouch ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 0); }
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")] protected override void WndProc(ref Message m) { // Decode and handle WM_TOUCH message. bool handled; Console.WriteLine(m.Msg); switch (m.Msg) { case WM_TOUCH: handled = DecodeTouch(ref m); break; default: handled = false; break; } // Call parent WndProc for default message processing. base.WndProc(ref m); if (handled) { // Acknowledge event if handled. m.Result = new System.IntPtr(1); } }