当前位置: 首页>>代码示例>>C#>>正文


C# KeyEventHandler类代码示例

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


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


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