• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# KeyEventHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中KeyEventHandler的典型用法代码示例。如果您正苦于以下问题:C# KeyEventHandler类的具体用法?C# KeyEventHandler怎么用?C# KeyEventHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KeyEventHandler类属于命名空间,在下文中一共展示了KeyEventHandler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MainForm

        public MainForm()
        {
            InitializeComponent();

            Text = "SharpMapTracker v" + Constants.MAP_TRACKER_VERSION;

            DataBindings.Add("TopMost", alwaysOnTopCheckBox, "Checked");
            DataBindings.Add("TrackMoveableItems", trackMoveableItemsCheckBox, "Checked");
            DataBindings.Add("TrackSplashes", trackSplashesCheckBox, "Checked");
            DataBindings.Add("TrackMonsters", trackMonstersCheckBox, "Checked");
            DataBindings.Add("TrackNPCs", trackNpcsCheckBox, "Checked");
            DataBindings.Add("TrackOnlyCurrentFloor", trackOnlyCurrentFloorCheckBox, "Checked");
            DataBindings.Add("RetrackTiles", retrackTilesToolStripMenuItem, "Checked");
            DataBindings.Add("NPCAutoTalk", npcAutoTalkCheckBox, "Checked");
            DataBindings.Add("ShareTrackedMap", shareTrackedMapCheckBox, "Checked");

            Trace.Listeners.Add(new TextBoxTraceListener(traceTextBox));
            Trace.Listeners.Add(new TextWriterTraceListener("log.txt"));

            Trace.AutoFlush = true;

            KeyDown += new KeyEventHandler(MainForm_KeyDown);
            Load += MainForm_Load;
            FormClosed += new FormClosedEventHandler(MainForm_FormClosed);
            miniMap.MiniMapClick += new EventHandler<MiniMapClickEventArgs>(miniMap_MiniMapClick);
        }
开发者ID:jrmsjorgesilva,项目名称:sharpmaptracker,代码行数:26,代码来源:MainForm.cs


示例2: NumberBox

 /*
  * The default constructor
  */
 public NumberBox()
 {
     this.InputScope = new InputScope();
     this.InputScope.Names.Add(new InputScopeName(InputScopeNameValue.Number));
     TextChanged += new TextChangedEventHandler(OnTextChanged);
     KeyDown += new KeyEventHandler(OnKeyDown);
 }
开发者ID:TheAngryByrd,项目名称:MetroPass,代码行数:10,代码来源:NumberBox.cs


示例3: PyjamaForm

        public PyjamaForm(string[] args)
        {
            InitializeComponent();
            KeyDown += new KeyEventHandler(mainForm_KeyDown);

            _controller = new PyjamaFormController(this);
            _printEngine = new PrintEngine(_controller);

            Text = string.Format(Text, ApplicationInformation.Title(), ApplicationInformation.Version());

            SetButtonsStatus();
            ApplyUserSettings(ApplicationOptions.LoadUserSettings(ApplicationOptions.GetIsolatedStorage()));
            //this.ActiveControl = this.outputWindow.output; // Output window gets cursor

            int opened = 0;
            foreach (string filename in args)
            {
                string fullFilename = Path.GetFullPath(filename);
                // FIXME: if file exists, or allow create, if dir exists?
                OpenFile(fullFilename);
                opened++;
            }
            if (opened == 0)
            {
                NewFile();
            }

            this.ActiveControl = _docManager.GetCurrentTabTextBox(); // tab text gets cursor
            // FIXME: make a general language changer
            this.languageName.Text = "Python";
            this.columnNumber.Text = "" + 1;
            this.lineNumber.Text = "" + 1;
        }
开发者ID:roboshepherd,项目名称:myro-epuck,代码行数:33,代码来源:PyjamaForm.cs


示例4: AboutWindow

 public AboutWindow(DynamoViewModel dynamoViewModel)
 {
     InitializeComponent();
     InstallNewUpdate = false;
     PreviewKeyDown += new KeyEventHandler(HandleEsc);
     DataContext = dynamoViewModel;
 }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:7,代码来源:AboutWindow.xaml.cs


示例5: mainWindow

 public mainWindow()
 {
     InitializeComponent();
     // Intializes this componet not really sure of its purpose
     // Ask Chris about this below
     KeyDown += new KeyEventHandler(Form1_KeyDown);
 }
开发者ID:bcbrown3484,项目名称:Take_Me_Code,代码行数:7,代码来源:Form1.cs


示例6: DashGlobal

        public DashGlobal(
            EventHandler<TextChangedEventArgs> textAreaTextChanged,
            EventHandler<TextChangedEventArgs> textAreaTextChangedDelayed,
            KeyEventHandler textAreaKeyUp,
            EventHandler textAreaSelectionChangedDelayed,
            DragEventHandler textAreaDragDrop,
            DragEventHandler textAreaDragEnter,
            TabControl mainTabControl,
            AutocompleteMenu armaSense,
            Main mainWindow)
        {
            EditorHelper = new EditorHelper(
                textAreaTextChanged,
                textAreaTextChangedDelayed,
                textAreaKeyUp,
                textAreaSelectionChangedDelayed,
                textAreaDragDrop,
                textAreaDragEnter,
                mainTabControl,
                armaSense,
                this);

            TabsHelper = new TabsHelper(
                textAreaTextChanged,
                textAreaSelectionChangedDelayed,
                mainTabControl,
                this);

            FilesHelper = new FilesHelper(this);
            SettingsHelper = new SettingsHelper();

            MainWindow = mainWindow;
        }
开发者ID:alandoherty,项目名称:dash-core,代码行数:33,代码来源:DashGlobal.cs


示例7: SpreadsheetView

        public SpreadsheetView()
            : base()
        {
            SpreadsheetModel = new SpreadsheetModel(new CellCollection());            
            Dock = DockStyle.Fill;
            CellMouseDoubleClick += new DataGridViewCellMouseEventHandler(SpreadsheetView_CellMouseDoubleClick);
            CellMouseClick += new DataGridViewCellMouseEventHandler(SpreadsheetView_CellMouseClick);
            RowHeaderMouseClick += new DataGridViewCellMouseEventHandler(SpreadsheetView_RowHeaderMouseClick);
            RowHeightChanged += new DataGridViewRowEventHandler(SpreadsheetView_RowHeightChanged);
            ColumnWidthChanged += new DataGridViewColumnEventHandler(SpreadsheetView_ColumnWidthChanged);
            KeyDown += new KeyEventHandler(SpreadsheetView_KeyDown);
            KeyUp += new KeyEventHandler(SpreadsheetView_KeyUp);
            ParentChanged += delegate
            {
                Columns.Clear();

                for (int k = 0; k < ColumnCount; k++)
                {
                    Columns.Add(MakeColumnLabel(k), MakeColumnLabel(k));
                    Columns[k].SortMode = DataGridViewColumnSortMode.NotSortable;
                }

                Rows.Add(RowCount);

                AllowUserToOrderColumns = false;
                SelectionMode = DataGridViewSelectionMode.ColumnHeaderSelect;
            };

            CellEndEdit += new DataGridViewCellEventHandler(SpreadsheetView_CellEndEdit);
            CellBeginEdit += new DataGridViewCellCancelEventHandler(SpreadsheetView_CellBeginEdit);
            RowsRemoved += new DataGridViewRowsRemovedEventHandler(SpreadsheetView_RowsRemoved);

            this.DefaultCellStyle.Font = new Font("Times", 12);
        }
开发者ID:nebenjamin,项目名称:cpsc-431-project,代码行数:34,代码来源:SpreadsheetView.cs


示例8: MainForm

        public MainForm()
        {
            InitializeComponent();

            setupSocketConnection();// We need to setup the socket connection first

            LogWriter writer = LogWriter.Instance;
            writer.WriteToLog("This is a test");
            writer.WriteToLog("WORK!");
            writer.WriteToLog("DealtDamage", "Hitted enemy for 10% damage");
            writer.WriteToLog("DamageRecieved", "Left tires hit. 10% damage");
            labelCamera.Text            = "100%";
            labelControllUnit.Text      = "100%";
            labelRightWheels.Text       = "100%";
            labelLeftWheels.Text        = "100%";
            labelAmmo.Text              = "100%";
            labelClip.Text =            "6 Ammo / 2 Clips";

            browser = new ChromiumWebBrowser("http://"+ Properties.Settings.Default.IPAddress + "/rcam/index.php");
            panel1.Controls.Add(browser);

            this.KeyPreview = true;
            KeyDown +=
                new KeyEventHandler(BattleHudKeyHandler);
        }
开发者ID:StarlightNL,项目名称:RPiControll,代码行数:25,代码来源:Form1.cs


示例9: MainWindow

 public MainWindow()
 {
     InitializeComponent();
     sb = new Sailboat();
     Loaded += new RoutedEventHandler(MainWindow_Loaded);
     PreviewKeyDown += new KeyEventHandler(MainWindow_PreviewKeyDown);
 }
开发者ID:khaledsaied,项目名称:GUI_LABS,代码行数:7,代码来源:MainWindow.xaml.cs


示例10: MainWindow

        public MainWindow()
        {
            InitializeComponent();

               // new list1<database.{Name=“Anuska Sharama”,Age=21,Email=“[email protected]”,Image=“anuska.jpg”},

              //ResearcherList.add_R_listitems(list1, rlist); //Traverse all the items of researcher list and add into Listbox

              // list1.ItemsSource = rlist;

            list1.ItemsSource = rlist;

            KeyDown += new KeyEventHandler(sc1_KeyDown);

            for (int i = 1900; i <= 2100; i++)
            {
                //int year = 1900;
                cbo1.Items.Add(i.ToString());
                cbo2.Items.Add(i.ToString());

            }
            //cbo1.
            cbo1.SelectedItem = "2000";
            //cbo1.SelectionLength = 5;
            cbo1.PopupMaxHeight = 30;
            //cbo1.MinHeight = 20;
            cbo1.PopupMaxHeight = 100;

            cbo2.SelectedItem = "2015";
            //cbo1.SelectionLength = 5;
            cbo2.PopupMaxHeight = 30;
            //cbo1.MinHeight = 20;
            cbo2.PopupMaxHeight = 100;
        }
开发者ID:BubbleKID,项目名称:HUMAN-RESOURCE-INFORMATION-SYSTEM-,代码行数:34,代码来源:MainWindow.xaml.cs


示例11: FloatingToolForm

        public FloatingToolForm()
        {
            this.KeyPreview = true;
            controlAddedDelegate = new ControlEventHandler(ControlAddedHandler);
            controlRemovedDelegate = new ControlEventHandler(ControlRemovedHandler);
            keyUpDelegate = new KeyEventHandler(KeyUpHandler);

            this.ControlAdded += controlAddedDelegate; // we don't override OnControlAdded so we can re-use the method (see code below for ControlAdded)
            this.ControlRemoved += controlRemovedDelegate;

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            try
            {
                SystemLayer.UserSessions.SessionChanged += new EventHandler(UserSessions_SessionChanged);
                Microsoft.Win32.SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged);
            }

            catch (Exception ex)
            {
                Tracing.Ping("Exception while signing up for some system events: " + ex.ToString());
            }
        }
开发者ID:metadeta96,项目名称:openpdn,代码行数:26,代码来源:FloatingToolForm.cs


示例12: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            StatusBarText = String.Empty;
            IsHlrOffPushed = false;
            IsHlrOnPushed = true;
            IsZoomWinEnabled = true;

            #region menu operations

            CommandBinding aBind_New = new CommandBinding( IECommands.New );
            aBind_New.Executed += NewCommand_Executed;
            CommandBindings.Add( aBind_New );

            CommandBinding aBind_Close = new CommandBinding( IECommands.Close );
            aBind_Close.Executed += CloseCommand_Executed;
            aBind_Close.CanExecute += CloseCommand_CanExecute;
            CommandBindings.Add( aBind_Close );

            CommandBinding aBind_Quit = new CommandBinding( IECommands.Quit );
            aBind_Quit.Executed += QuitCommand_Executed;
            CommandBindings.Add( aBind_Quit );

            CommandBinding aBind_About = new CommandBinding( IECommands.About );
            aBind_About.Executed += AboutCommand_Executed;
            CommandBindings.Add( aBind_About );

            # endregion

            PreviewKeyDown += new KeyEventHandler( OnPreviewKeyDown );
            PreviewKeyUp += new KeyEventHandler( OnPreviewKeyUp );
        }
开发者ID:i2e-haw-hamburg,项目名称:opencascade,代码行数:33,代码来源:MainWindow.xaml.cs


示例13: InitializeEvents

        /// <summary>
        /// Initialize class events.
        /// </summary>
        private void InitializeEvents()
        {
            TextChanged += new EventHandler(HandleTextChanged);
            UpdateUI += new EventHandler<UpdateUIEventArgs>(HandleUpdateUI);

            // enable drag & drop
            AllowDrop = true;
            DragOver += new DragEventHandler(HandleDragOver);
            DragDrop += new DragEventHandler(HandleDragDrop);

            // search & replace
            KeyUp += new KeyEventHandler(HandleKeyUp);
            KeyDown += new KeyEventHandler(HandleKeyDown);
            InsertCheck += new EventHandler<InsertCheckEventArgs>(HandleInsertCheck);
            CharAdded += new EventHandler<CharAddedEventArgs>(HandleCharAdded);
            
            MouseWheel += new MouseEventHandler(HandleMouseWheel);
            Painted += new EventHandler<EventArgs>(HandlePainted);

            // create default pens
            grayPen = new Pen(Brushes.Gray);
            dashedPen = new Pen(Brushes.LightGray);
            dashedPen.DashPattern = new[] { 3f, 6f };

            // measure default line size
            lineSize = TextRenderer.MeasureText(new string('/', NewLineHelper), Font);
        }
开发者ID:h3tch,项目名称:ProtoFX,代码行数:30,代码来源:CodeEditor.Events.cs


示例14: MainForm_Load

        private void MainForm_Load(object sender, EventArgs e)
        {
            KeyDown += new KeyEventHandler(InputHandler.OnKeyDown);
            KeyUp += new KeyEventHandler(InputHandler.OnKeyUp);

            game.Start();
        }
开发者ID:DotTech,项目名称:3D-software-renderer,代码行数:7,代码来源:MainForm.cs


示例15: CatchHotkey_Load

 private void CatchHotkey_Load(object sender, EventArgs e)
 {
     KeyPreview = true;
     KeyDown += new KeyEventHandler(CatchHotkey_KeyDown);
     KeyUp += new KeyEventHandler(CatchHotkey_KeyUp);
     Closed += new EventHandler(CatchHotkey_Closed);
 }
开发者ID:sinterlkaas,项目名称:YetAnotherRelogger,代码行数:7,代码来源:CatchHotkey.cs


示例16: Init

		private void Init()
		{
			InitializeComponent();

			MouseUp += new MouseEventHandler(OnMouseUp);
			KeyUp += new KeyEventHandler(OnKeyUp);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:7,代码来源:FeatureStructureTreeView.cs


示例17: Surface

        public Surface(Image backgroundImage = null)
        {
            ScreenRectangle = CaptureHelpers.GetScreenBounds();
            ScreenRectangle0Based = CaptureHelpers.FixScreenCoordinates(ScreenRectangle);

            InitializeComponent();

            SurfaceImage = backgroundImage;
            Prepare();

            DrawableObjects = new List<DrawableObject>();
            Config = new SurfaceOptions();
            timer = new Stopwatch();

            borderPen = new Pen(Color.DarkBlue);
            borderDotPen = new Pen(Color.Black, 1);
            borderDotPen.DashPattern = new float[] { 5, 5 };
            borderDotPen2 = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            borderDotPen2.DashOffset = 5;
            shadowBrush = new SolidBrush(Color.FromArgb(75, Color.Black));
            lightBrush = new SolidBrush(Color.FromArgb(10, Color.Black));
            nodeBackgroundBrush = new SolidBrush(Color.White);
            textFont = new Font("Arial", 12, FontStyle.Bold);

            Shown += new EventHandler(Surface_Shown);
            KeyUp += new KeyEventHandler(Surface_KeyUp);
            MouseDoubleClick += new MouseEventHandler(Surface_MouseDoubleClick);
        }
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:29,代码来源:Surface.cs


示例18: DropEdit

		public DropEdit(string id, string dropChance, ServerDbs sdb, GenericDatabase gdb) : base("Item edit", "cde.ico", SizeToContent.Height, ResizeMode.NoResize) {
			_id = id;
			_dropChance = dropChance;
			_sdb = sdb;
			_gdb = gdb;

			InitializeComponent();

			_tbChance.Text = _dropChance;
			_tbId.Text = _id;

			PreviewKeyDown += new KeyEventHandler(_dropEdit_PreviewKeyDown);

			Loaded += delegate {
				_tbChance.SelectAll();
				_tbChance.Focus();
			};

			if (sdb != null) {
				_buttonQuery.Click += new RoutedEventHandler(_buttonQuery_Click);
			}
			else {
				_buttonQuery.Visibility = Visibility.Collapsed;
			}
		}
开发者ID:Tokeiburu,项目名称:RagnarokSDE,代码行数:25,代码来源:DropEdit.xaml.cs


示例19: Board

 public Board()
 {
     BackColor = Color.Black;
     DoubleBuffered = true;
     this.ClientSize = new Size(width, height);
     try {
         dot   = new Bitmap("dot.png");
         apple = new Bitmap("apple.png");
         head  = new Bitmap("head.png");
     } catch (Exception e) {
         Console.WriteLine(e.Message);
         Environment.Exit(1);
     }
     for (int z = 0; z < dots; z++) {
         x[z] = startPos - z * dotSize;
         y[z] = startPos;
     }
     locateApple();
     timer = new Timer();
     timer.Enabled = true;
     timer.Interval = 100;
     timer.Tick += new System.EventHandler(this.OnTick);
     Paint += new PaintEventHandler(this.OnPaint);
     KeyUp += new KeyEventHandler(OnKeyUp);
 }
开发者ID:JohanMoreau,项目名称:dev-koans,代码行数:25,代码来源:Board.cs


示例20: TextBoxNum

        /*
         * The default constructor
         */
        public TextBoxNum()
        {
            VerticalContentAlignment = System.Windows.VerticalAlignment.Center;

            TextChanged += new TextChangedEventHandler(OnTextChanged);
            KeyDown += new KeyEventHandler(OnKeyDown);
        }
开发者ID:hugoestr,项目名称:calculr_waves,代码行数:10,代码来源:TextBoxNum.cs



注:本文中的KeyEventHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# KeyHandler类代码示例发布时间:2022-05-24
下一篇:
C# KeyEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap