System.Windows.Forms.ContainerControl.ProcessCmdKey(ref System.Windows.Forms.Message, System.Windows.Forms.Keys)

Here are the examples of the csharp api class System.Windows.Forms.ContainerControl.ProcessCmdKey(ref System.Windows.Forms.Message, System.Windows.Forms.Keys) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

38 Examples 7

1. Example

View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            var host = Parent as AutocompleteMenuHost;
            if (host != null)
                if (host.Menu.ProcessKey((char) keyData, Keys.None))
                    return true;

            return base.ProcessCmdKey(ref msg, keyData);
        }

2. Example

Project: Gum
Source File: StateView.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            bool isHandled = StateTreeViewManager.Self.TryHandleCmdKey(keyData);


            if (isHandled)
            {
                return true;
            }
            else
            { 
                return base.ProcessCmdKey(ref msg, keyData);
            }
        }

3. Example

Project: codegenerator
Source File: NavigatorControl.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
		{
            /*
			if(_shortcuts.ShortcutActivated(keyData))
				return true;
             */

			return base.ProcessCmdKey (ref msg, keyData);
		}

4. Example

Project: bvcms
Source File: AttendHome.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
		{
			const int WM_KEYDOWN = 0x100;
			const int WM_SYSKEYDOWN = 0x104;

			if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN)) {
				switch (keyData) {
					case Keys.S | Keys.Alt:
						this.Swap(namesearch);
						break;
				}
			}
			return base.ProcessCmdKey(ref msg, keyData);
		}

5. Example

Project: bvcms
Source File: BuildingHome.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                switch (keyData)
                {
                    case Keys.S | Keys.Alt:
                        this.Swap(namesearch);
                        break;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

6. Example

Project: mbunit-v3
Source File: ProjectExplorerView.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.Delete && projectTree.SelectedNode != null 
                && projectTree.SelectedNode.Tag is ReportNode)
            {
                var selectedNode = projectTree.SelectedNode;
                projectTree.SelectedNode = selectedNode.NextNode;
                DeleteReport((ReportNode)selectedNode.Tag);
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

7. Example

View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (HotkeysEnabled && this.Hotkeys != null)
                foreach (var hotkey in this.Hotkeys)
                {
                    if (hotkey != null && hotkey.KeyData == keyData)
                    {
                        return ExecuteCommand(hotkey.CommandCode);
                    }
                }

            return base.ProcessCmdKey(ref msg, keyData);
        }

8. Example

View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == (Keys.Shift | Keys.Alt | Keys.C))
            {
                this.InitializeAndCompareTabularModels();
                return true;
            }

            return base.ProcessCmdKey(ref msg, keyData);
        }

9. Example

Project: P8Coder
Source File: AutocompleteMenu.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            ProcessKey(keyData, Keys.None);
            
            return base.ProcessCmdKey(ref msg, keyData);
        }

10. Example

View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            ProcessKey(keyData, Keys.None);
            
            return base.ProcessCmdKey(ref msg, keyData);
        }

11. Example

Project: dash-core
Source File: AutocompleteMenu.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            ProcessKey(keyData, Keys.None);
            
            return base.ProcessCmdKey(ref msg, keyData);
        }

12. Example

Project: OpenLiveWriter
Source File: ColorPickerForm.cs
View license
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.Up)
            {
                Navigate(new NavigateEventArgs(false));
                return true;
            }
            else if (keyData == Keys.Down)
            {
                Navigate(new NavigateEventArgs(true));
                return true;
            }

            return base.ProcessCmdKey(ref msg, keyData);
        }

13. Example

Project: OpenLiveWriter
Source File: ChoiceOption.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
                case Keys.Enter:
                case Keys.Space:
                    OnClick(EventArgs.Empty);
                    return true;
                default:
                    return base.ProcessCmdKey(ref msg, keyData);
            }
        }

14. Example

Project: OpenLiveWriter
Source File: ImageCropControl.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
                case Keys.Up | Keys.Control:
                case Keys.Up:
                    return AdjustCropRectangle(0, -1, 0, 0);
                case Keys.Down | Keys.Control:
                case Keys.Down:
                    return AdjustCropRectangle(0, 1, 0, 0);
                case Keys.Left | Keys.Control:
                case Keys.Left:
                    return AdjustCropRectangle(-1, 0, 0, 0);
                case Keys.Right | Keys.Control:
                case Keys.Right:
                    return AdjustCropRectangle(1, 0, 0, 0);
                case Keys.Left | Keys.Shift:
                    return AdjustCropRectangle(0, 0, -1, 0);
                case Keys.Right | Keys.Shift:
                    return AdjustCropRectangle(0, 0, 1, 0);
                case Keys.Up | Keys.Shift:
                    return AdjustCropRectangle(0, 0, 0, -1);
                case Keys.Down | Keys.Shift:
                    return AdjustCropRectangle(0, 0, 0, 1);
            }

            return base.ProcessCmdKey(ref msg, keyData);
        }

15. Example

View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            // delete key deletes items
            if (keyData == Keys.Delete)
            {
                DeleteSelectedEntry();
                return true;
            }
            else // delegate to base
            {
                return base.ProcessCmdKey(ref msg, keyData);
            }
        }

16. Example

View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            // delete key deletes items
            if (keyData == Keys.Delete)
            {
                DeleteSelectedItem();
                return true;
            }
            else // delegate to base
            {
                return base.ProcessCmdKey(ref msg, keyData);
            }
        }

17. Example

View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            // delete key deletes items
            if (keyData == Keys.Delete && DeleteCommandEnabled)
            {
                DeleteSelectedWeblog();
                return true;
            }
            else // delegate to base
            {
                return base.ProcessCmdKey(ref msg, keyData);
            }
        }

18. Example

Project: ynoteclassic
Source File: AutocompleteMenu.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            ProcessKey(keyData, Keys.None);

            return base.ProcessCmdKey(ref msg, keyData);
        }

19. Example

Project: bvcms
Source File: AttendListClasses.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                switch (keyData)
                {
                    case Keys.PageUp:
                        if (pgup.Visible)
                            ShowPage(page - 1);
                        return true;
                    case Keys.PageDown:
                        if (pgdn.Visible)
                            ShowPage(page + 1);
                        return true;
                    case Keys.Escape:
                        this.Swap(Program.attendHome.family);
                        Program.attendHome.family.ShowFamily(FamilyId);
                        return true;
                    case Keys.S | Keys.Alt:
                        Program.TimerReset();
                        Program.CursorShow();
                        return true;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

20. Example

Project: bvcms
Source File: BuildingListFamily.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
		{
			const int WM_KEYDOWN = 0x100;
			const int WM_SYSKEYDOWN = 0x104;

			if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN)) {
				switch (keyData) {
					case Keys.PageUp:
						if (pgup.Visible)
							ShowPage(page - 1);
						return true;
					case Keys.PageDown:
						if (pgdn.Visible)
							ShowPage(page + 1);
						return true;
					case Keys.Escape:
						Program.TimerStop();
						this.GoHome(string.Empty);
						return true;
					case Keys.Return:
						Program.TimerStop();
						//DoPrinting(null, null);
						this.GoHome(string.Empty);
						return true;
					case Keys.S | Keys.Alt:
						Program.TimerReset();
						Program.CursorShow();
						foreach (var c in sucontrols) {
							c.Enabled = true;
							c.BackColor = Color.Coral;
						}
						return true;
				}
			}
			return base.ProcessCmdKey(ref msg, keyData);
		}

21. Example

Project: bvcms
Source File: CommonListFamilies.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                switch (keyData)
                {
                    case Keys.PageUp:
                        if (pgup.Visible)
                            ShowFamilies(prev);
                        return true;
                    case Keys.PageDown:
                        if (pgdn.Visible)
                            ShowFamilies(next);
                        return true;
                    case Keys.Escape:
                        Program.TimerStop();
                        this.GoHome(string.Empty);
                        return true;
                    case Keys.S | Keys.Alt:
                        Program.TimerReset();
                        Program.CursorShow();
                        return true;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

22. Example

Project: bvcms
Source File: EnterDate.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                switch (keyData)
                {
                    case Keys.Tab:
                        Program.TimerStop();
                        GoNext(this, new EventArgs());
                        return true;
                    case Keys.Shift | Keys.Tab:
                        Program.TimerStop();
                        GoBack(this, new EventArgs());
                        return true;
                    case Keys.S | Keys.Alt:
                        Program.TimerReset();
                        Program.CursorShow();
                        return true;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

23. Example

Project: bvcms
Source File: EnterNumber.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                switch (keyData)
                {
                    case Keys.Tab:
                        Program.TimerStop();
                        GoNext(this, new EventArgs());
                        return true;
                    case Keys.Shift | Keys.Tab:
                        Program.TimerStop();
                        GoBack(this, new EventArgs());
                        return true;
                    case Keys.S | Keys.Alt:
                        Program.TimerReset();
                        Program.CursorShow();
                        return true;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

24. Example

Project: bvcms
Source File: EnterPhone.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                switch (keyData)
                {
                    case Keys.Tab:
                        Program.TimerStop();
                        GoNext(this, new EventArgs());
                        return true;
                    case Keys.Shift | Keys.Tab:
                        Program.TimerStop();
                        GoBack(this, new EventArgs());
                        return true;
                    case Keys.S | Keys.Alt:
                        Program.TimerReset();
                        Program.CursorShow();
                        return true;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

25. Example

Project: bvcms
Source File: EnterText.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                switch (keyData)
                {
                    case Keys.Tab:
                        Program.TimerStop();
                        GoNext(this, new EventArgs());
                        return true;
                    case Keys.Shift | Keys.Tab:
                        Program.TimerStop();
                        GoBack(this, new EventArgs());
                        return true;
                    case Keys.S | Keys.Alt:
                        Program.TimerReset();
                        Program.CursorShow();
                        return true;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

26. Example

Project: sdrsharp
Source File: FrequencyEdit.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {        
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                return DigitKeyHandler(new KeyEventArgs(keyData));
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

27. Example

Project: BismNormalizer
Source File: ComparisonControl.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == (Keys.Shift | Keys.Alt | Keys.C))
            {
                this.InitializeAndCompareTabularModels();
                return true;
            }

            return base.ProcessCmdKey(ref msg, keyData);
        }

28. Example

Project: NSMB-Editor
Source File: TilemapEditorControl.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            int idx = -1;
            if (keyData == Keys.D) idx = 0;
            if (keyData == Keys.X) idx = 1;
            if (keyData == Keys.Y) idx = 2;
            if (keyData == Keys.C) idx = 3;
            if (keyData == Keys.V) idx = 4;
            if (keyData == Keys.P) idx = 5;

            if (idx > -1)
            {
                ed.setMode((EditionMode)idx);
                return true;
            }
            if (keyData == (Keys.Control | Keys.Z))
            {
                Undo(null, null);
                return true;
            }
            if (keyData == (Keys.Control | Keys.Y))
            {
                Redo(null, null);
                return true;
            }
            if (keyData == (Keys.Control | Keys.S))
            {
                t.save();
                return true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

29. Example

Project: OpenLiveWriter
Source File: BitmapButton.cs
View license
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            Keys key = keyData & ~(Keys.Control | Keys.Shift);
            if (IsPushKey(key))
            {
                PushByKeystroke();
                return true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

30. Example

View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.Enter && !_refreshing)
            {
                RequestRefresh();
                return true;
            }
            else if (keyData == Keys.Up)
            {
                if (Parent != null)
                    Parent.SelectNextControl(this, false, true, true, true);
                return true;
            }
            else if (keyData == Keys.Down)
            {
                if (Parent != null)
                    Parent.SelectNextControl(this, true, true, true, true);
                return true;
            }
            return base.ProcessCmdKey (ref msg, keyData);
        }

31. Example

Project: StackBuilder
Source File: FileSelect.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.F3)
            {
                Browse();
                return true;
            }
            if (keyData == Keys.Enter)
            {
                EndEditCurrentFile();
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

32. Example

Project: bvcms
Source File: AttendListFamily.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                switch (keyData)
                {
                    case Keys.PageUp:
                    if (pgup.Visible)
                        ShowPage(page - 1);
                    return true;
                    case Keys.PageDown:
                    if (pgdn.Visible)
                        ShowPage(page + 1);
                    return true;
                    case Keys.Escape:
                    Program.TimerStop();
                    this.GoHome(string.Empty);
                    return true;
                    case Keys.Return:
                    Program.TimerStop();
                    DoPrinting(null, null);
                    this.GoHome(string.Empty);
                    return true;
                    case Keys.S | Keys.Alt:
                    Program.TimerReset();
                    Program.CursorShow();
                    foreach (var c in sucontrols)
                    {
                        c.Enabled = true;
                        c.BackColor = Color.Coral;
                    }
                    return true;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

33. Example

Project: bvcms
Source File: CommonListNames.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
            {
                switch (keyData)
                {
                    case Keys.PageUp:
                        if (pgup.Visible)
                            ShowResults(name, prev.Value);
                        return true;
                    case Keys.PageDown:
                        if (pgdn.Visible)
                            ShowResults(name, next.Value);
                        return true;
                    case Keys.Escape:
                        Program.TimerStop();
                        if (Program.settings.hideCursor)
                            Cursor.Hide();
                        this.GoHome(string.Empty);
                        return true;
                    case Keys.S | Keys.Alt:
                        Program.TimerReset();
                        Program.CursorShow();
                        foreach (var c in sucontrols)
                        {
                            c.Enabled = true;
                            c.BackColor = Color.Coral;
                        }
                        return true;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

34. Example

Project: winforms
Source File: PropertyGrid.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
		{
			if (keyData.HasFlag(Keys.Up) || keyData.HasFlag(Keys.Down) || keyData.HasFlag(Keys.Left) || keyData.HasFlag(Keys.Right) || keyData.HasFlag(Keys.Tab))
			{
				KeyEventArgs args = new KeyEventArgs(keyData);
				args.Handled = false;
				this.OnKeyDown(args);
				if (args.Handled) return true;
			}
			return base.ProcessCmdKey(ref msg, keyData);
		}

35. Example

Project: SPICA
Source File: SUIList.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
                case Keys.Up:     SelectUp();   break;
                case Keys.Down:   SelectDown(); break;
                case Keys.Escape: Select(-1);   break;
            }

            return base.ProcessCmdKey(ref msg, keyData);
        }

36. Example

Project: TSqlFlex
Source File: FlexMainWindow.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            var control = FindFocusedControl(this);

            if (keyData == (Keys.Control | Keys.A))
            {
                if (control == txtSqlInput || control == txtOutput)
                {
                    var txt = control as TextBox;
                    txt.SelectAll();
                }
                return true;
            }
            else if (keyData == (Keys.Control | Keys.C))
            {
                if (control == txtSqlInput || control == txtOutput)
                {
                    var txt = control as TextBox;
                    CopyThisTextOrShowErrorMessageBox(txt.SelectedText);
                }
                return true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        
        }

37. Example

Project: logwizard
Source File: log_view.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
            bool is_renaming /n ..... /n //View Source file for more details /n }

38. Example

Project: NSMB-Editor
Source File: LevelEditorControl.cs
View license
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            Console.O/n ..... /n //View Source file for more details /n }