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

C# Forms.Timer类代码示例

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

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



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

示例1: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
         System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Splash));
         this.pictureBox1 = new System.Windows.Forms.PictureBox();
         this.timer1 = new System.Windows.Forms.Timer(this.components);
         this.SuspendLayout();
         //
         // pictureBox1
         //
         this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
         this.pictureBox1.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBox1.Image")));
         this.pictureBox1.Name = "pictureBox1";
         this.pictureBox1.Size = new System.Drawing.Size(632, 416);
         this.pictureBox1.TabIndex = 0;
         this.pictureBox1.TabStop = false;
         //
         // Splash
         //
         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
         this.ClientSize = new System.Drawing.Size(632, 416);
         this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                       this.pictureBox1});
         this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         this.Name = "Splash";
         this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
         this.Text = "Splash";
         this.ResumeLayout(false);
 }
开发者ID:mymindleaks,项目名称:dX---discover-and-eXplore,代码行数:33,代码来源:Splash.cs


示例2: IFProcessor

 public IFProcessor(ISharpControl control)
 {
     this._control = control;
       this._control.PropertyChanged += new PropertyChangedEventHandler(this.NotifyPropertyChangedHandler);
       this._fftTimer = new System.Windows.Forms.Timer();
       this._fftTimer.Tick += new EventHandler(this.fftTimer_Tick);
       this._fftTimer.Interval = 40;
       this._fftBins = 8192;
       this.InitFFTBuffers();
       this.BuildFFTWindow();
       this._spectrumAnalyzer = new SpectrumAnalyzer();
       this._spectrumAnalyzer.Dock = DockStyle.Fill;
       this._spectrumAnalyzer.Margin = new Padding(0, 0, 0, 0);
       this._spectrumAnalyzer.DisplayRange = 130;
       this._spectrumAnalyzer.EnableFilter = false;
       this._spectrumAnalyzer.EnableHotTracking = false;
       this._spectrumAnalyzer.EnableSideFilterResize = true;
       this._spectrumAnalyzer.EnableFilterMove = false;
       this._spectrumAnalyzer.BandType = BandType.Center;
       this._spectrumAnalyzer.StepSize = 1000;
       this._spectrumAnalyzer.UseSmoothing = true;
       this._spectrumAnalyzer.Attack = 0.9f;
       this._spectrumAnalyzer.Decay = 0.6f;
       this._spectrumAnalyzer.StatusText = "IF Spectrum";
       this._spectrumAnalyzer.FrequencyChanged += new ManualFrequencyChangeEventHandler(this.spectrumAnalyzer_FrequencyChanged);
       this._spectrumAnalyzer.CenterFrequencyChanged += new ManualFrequencyChangeEventHandler(this.spectrumAnalyzer_CenterFrequencyChanged);
       this._spectrumAnalyzer.BandwidthChanged += new ManualBandwidthChangeEventHandler(this.spectrumAnalyzer_BandwidthChanged);
       this._spectrumAnalyzer.VisibleChanged += new EventHandler(this.spectrumAnalyzer_VisibleChanged);
       this._control.RegisterStreamHook((object) this, ProcessorType.DecimatedAndFilteredIQ);
       this._control.RegisterFrontControl((UserControl) this._spectrumAnalyzer, (PluginPosition) Utils.GetIntSetting("zoomPosition", 1));
 }
开发者ID:zloiia,项目名称:sdrsrc,代码行数:31,代码来源:IFProcessor.cs


示例3: LeanEngineWinForm

        /// <summary>
        /// Launch the Lean Engine Primary Form:
        /// </summary>
        /// <param name="engine">Accept the engine instance we just launched</param>
        public LeanEngineWinForm(Engine engine)
        {
            _engine = engine;
            //Setup the State:
            _resultsHandler = engine.AlgorithmHandlers.Results;

            //Create Form:
            Text = "QuantConnect Lean Algorithmic Trading Engine: v" + Constants.Version;
            Size = new Size(1024,768);
            MinimumSize = new Size(1024, 768);
            CenterToScreen();
            WindowState = FormWindowState.Maximized;
            Icon = new Icon("../../../lean.ico");

            //Setup Console Log Area:
            _console = new RichTextBox();
            _console.Parent = this;
            _console.ReadOnly = true;
            _console.Multiline = true;
            _console.Location = new Point(0, 0);
            _console.Dock = DockStyle.Fill;
            _console.KeyUp += ConsoleOnKeyUp;
            
            //Form Events:
            Closed += OnClosed;

            //Setup Polling Events:
            _polling = new Timer();
            _polling.Interval = 1000;
            _polling.Tick += PollingOnTick;
            _polling.Start();
        }
开发者ID:skyfyl,项目名称:Lean,代码行数:36,代码来源:LeanEngineWinForm.cs


示例4: InitTimer

 public void InitTimer()
 {
     _timer = new Timer();
     _timer.Tick += new EventHandler(button1_Click);
     _timer.Interval = Convert.ToInt32(Options.Instance.TimerInterval);
     _timer.Start();
 }
开发者ID:vitobcn,项目名称:cryptoTriangular,代码行数:7,代码来源:MainWindow.cs


示例5: InitializeXBox360Timer

 private void InitializeXBox360Timer()
 {
     Timer timer = new Timer { Enabled = true };
     int guideCounter = 0;
     timer.Tick += (sender, args) =>
     {
         if (AnyGamepadHasButton(XBox360GamepadButton.Guide) && !IsVisible)
         {
             guideCounter++;
             if (guideCounter == 10)
             {
                 Show();
             }
         }
         else if (AnyGamepadHasButton(XBox360GamepadButton.B) && IsVisible)
         {
             Hide();
         }
         else if (AnyGamepadHasButton(XBox360GamepadButton.X) && IsVisible)
         {
             PowerOff();
         }
         else
         {
             guideCounter = 0;
         }
     };
 }
开发者ID:mina-asham,项目名称:XBox360ControllerManager,代码行数:28,代码来源:MainWindow.xaml.cs


示例6: Menu

 public Menu(SquareList list)
 {
     children = list;
     myTimer = new Timer();
     myTimer.Interval = 90000;
     myTimer.Enabled = true;
 }
开发者ID:RiedigerD2,项目名称:OpenHouse,代码行数:7,代码来源:Menu.cs


示例7: startButton_Click

        private void startButton_Click(object sender, EventArgs e)
        {
            SynchronizationContext ctx = SynchronizationContext.Current;
            

            // Save the new gesture name to gestureInfoNew.data
            string name = gestureName.Text;
            Gestures.addNewGesture(name);
            Gestures.saveData(GestureStudio.GesturesDataPathNew);
            Gestures.loadData(GestureStudio.GesturesDataPathNew);

            // Count down 5.
            int countDown = 5;
            System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
            timer.Interval = 1000;
            timer.Tick += (o, src) =>
                {
                    countDown--;
                    ctx.Post((state) =>
                        {
                            this.countDownLabel.Text = countDown.ToString();
                        }, null);

                    if (countDown == 0)
                    {
                        this.OnStart();
                        timer.Stop();
                        countDown = 5;
                        this.countDownLabel.Text = countDown.ToString();
                        this.gestureName.Text = "Name of the new gesture.";
                    }
                };

            timer.Start();
        }
开发者ID:lichiconstant,项目名称:KinectCapstone,代码行数:35,代码来源:TrainingStartForm.cs


示例8: MonitorConfigurationWatcher

		public MonitorConfigurationWatcher()
		{
			_checkTimer = new Timer();
			_checkTimer.Enabled = false;
			_checkTimer.Interval = 2500;
			_checkTimer.Tick += OnCheckTimerTick;
		}
开发者ID:w01f,项目名称:VolgaTeam.Dashboard,代码行数:7,代码来源:MonitorConfigurationWatcher.cs


示例9: GameTime

 static GameTime()
 {
     _staticReference = new GameTime();
     game = new Timer();
     game.Interval = 30;
     game.Tick += game_Tick;
 }
开发者ID:TekuConcept,项目名称:Folding-Atomata,代码行数:7,代码来源:GameTime.cs


示例10: ApplicationContext

        public ApplicationContext()
        {
            if (Properties.Settings.Default.CallUpgrade)
              {
            Properties.Settings.Default.Upgrade();
            Properties.Settings.Default.CallUpgrade = false;
            Properties.Settings.Default.Save();
              }

              _components = new System.ComponentModel.Container();
              _notifyIcon = new NotifyIcon(_components)
              {
            ContextMenuStrip = new ContextMenuStrip(),
            Visible = true
              };
              _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripMenuItem("Settings", null, new EventHandler(MenuSettingsItem_Click)));
              _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripMenuItem("Exit", null, new EventHandler(MenuExitItem_Click)));

              _buddies = new Buddies();

              _housekeepingTimer = new System.Windows.Forms.Timer();
              _housekeepingTimer.Interval = 5000;
              _housekeepingTimer.Tick += HousekeepingTimer_Tick;
              HousekeepingTimer_Tick(null, null);     // tick anyway enables timer when finished

              _trackerStatus = TrackerStatus.OK;

              if (trackersConfigured())
              {
            _trackerStatus = TrackerStatus.UNKNOWN;
            UpdateTrackerSetting();
              }

              _viewModel = new ViewModel(_buddies);
        }
开发者ID:der-dirk,项目名称:LyncFellow,代码行数:35,代码来源:Program.cs


示例11: MainForm

		public MainForm(MainModel model)
			: this()
		{
			_model = model;
			_model.TrayIcon = _trayIcon;
			_presenter = new MainPresenter(this, model, SynchronizationContext.Current);
			_presenter.ConnectEvents();
			this.Closing += (sender, args) => _presenter.DisconnectEvents();
			
            _trayIconTimer = new Timer();
            _trayIconTimer.Interval = 750;
            _trayIconTimer.Tick += OnTrayIconTimerTick;

		    _shutdownTimer = new Timer();
		    _shutdownTimer.Interval = 20000;
            _shutdownTimer.Tick += ShutdownTimerOnTick;

			_progressView = new ProgressView(new ProgressModel(model.UploadManager));
			_processing = true;
			_trayIconTimer.Start();

			Logger.LogInfo("MainForm initialized.");
			if (_trayIcon != null)
				_trayIcon.SetTrayIconVisibility(true);

        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:26,代码来源:MainForm.cs


示例12: SetupDrawLoop

 /// <summary>
 /// Setups the timer that triggers the update loop
 /// </summary>
 private void SetupDrawLoop()
 {
     Timer timer = new Timer();
     timer.Interval = _updateIntervalMills;
     timer.Tick += TimerTick;
     timer.Start();
 }
开发者ID:Kanpai888,项目名称:AntsSimulator,代码行数:10,代码来源:AntForm.cs


示例13: btn_BLKWHTAUTO_Click

        private void btn_BLKWHTAUTO_Click(object sender, EventArgs e)
        {
            //:Let them know this is a larger operation.
              this.Text = "Please be patient, this is a larger comparison.";

              //:We do NOT want them clicking while the thread is running.
              ButtonsEnabled(false);
              btn_Refresh.Enabled    = false;
              btn_newIMG.Enabled     = false;
              btn_Export.Enabled     = false;
              btn_GRYSCL.Enabled     = false;
              btn_BLKWHT.Enabled     = false;
              nud_BWSCALE.Enabled    = false;
              btn_BLKWHTAUTO.Enabled = false;
              ready = false; //:Not ready to continue other functions. [excluding this]

              //:Start a timer along with a thread to multithread the process gargling AutoBW
              System.Windows.Forms.Timer t = new System.Windows.Forms.Timer();
              t.Interval = 1000;
              t.Tick += new EventHandler(t_Tick);

              Thread th = new Thread(new ThreadStart(BWAUTO_TH));
              t.Start();
              th.Start();
        }
开发者ID:Theta-Z,项目名称:Basic-Stuff,代码行数:25,代码来源:Form1.cs


示例14: MainForm_Load

        private void MainForm_Load(Object sender, EventArgs e)
        {
            // bind connection Strings to the dropdown lists
            cboPersistenceService.DisplayMember = "Name";
            cboTrackingService.DisplayMember = "Name";
            foreach (ConnectionStringSettings connectionStringSetting in ConfigurationManager.ConnectionStrings)
            {
                cboPersistenceService.Items.Add(connectionStringSetting);
                cboTrackingService.Items.Add(connectionStringSetting);
            }

            cboTrackingService.Items.Insert(0, "None");

            if (cboPersistenceService.Items.Count > 0)
                cboPersistenceService.SelectedIndex = 0;

            if (cboTrackingService.Items.Count > 0)
                cboTrackingService.SelectedIndex = 0;

            // configure delegate trace listener
            DelegateTraceListener traceListener = new DelegateTraceListener();
            traceListener.WriteDelegate += traceListener_WriteDelegate;
            traceListener.WriteLineDelegate += traceListener_WriteDelegate;
            Trace.Listeners.Add(traceListener);

            // and the timer to flush messages to the message box
            traceDelegate = traceToMessageBox;
            timer = new Timer();
            timer.Interval = 1000;
            timer.Tick += timer_Tick;
            timer.Start();
        }
开发者ID:JuRogn,项目名称:OA,代码行数:32,代码来源:MainForm.cs


示例15: StatusStripExtender

        /// <summary>
        /// Initializes a new instance of the <see cref="StatusStripExtender"/> class.
        /// </summary>
        public StatusStripExtender()
        {
            _timer = new Timer { Enabled = false, Interval = _statusDefaultDuration };
            _timer.Tick += _timer_Tick;

            _toolTipList = new StringCollection();
        }
开发者ID:transformersprimeabcxyz,项目名称:cslacontrib-MarimerLLC,代码行数:10,代码来源:StatusStripExtender.cs


示例16: FrmMain

        public FrmMain()
        {
            InitializeComponent();

            _timer = new Timer();
            _timer.Tick += timer_Tick;
        }
开发者ID:vitalyobukhov,项目名称:WindowsObliqueStrategies,代码行数:7,代码来源:Main.cs


示例17: MainForm

        public MainForm()
        {
            InitializeComponent();

            if (!string.IsNullOrEmpty(Program.directory))
            {
                this.Text += "-[" + Program.directory + "]";
            }

            #if DEBUG
            diskSpaceCheckTimer.Interval = 1000 * 60;
            #endif

            config.GetLineCameras();
            Properties.Settings setting = Properties.Settings.Default;

            cpuCounter = new PerformanceCounter();
            ramCounter = new PerformanceCounter("Memory", "Available MBytes");

            cpuCounter.CategoryName = "Processor";
            cpuCounter.CounterName = "% Processor Time";
            cpuCounter.InstanceName = "_Total";

            time = new System.Windows.Forms.Timer();
            time.Tick += time_Elapsed;
            time.Interval = 3000;
            time.Enabled = true;

            InitStatusBar();
        }
开发者ID:dalinhuang,项目名称:appcollection,代码行数:30,代码来源:MainForm.cs


示例18: InitTimeRemainingTimer

 private void InitTimeRemainingTimer()
 {
     Timer singleQuestionTimer = new Timer();
     singleQuestionTimer.Interval = 100;
     singleQuestionTimer.Tick += singleQuestionTimer_Tick;
     singleQuestionTimer.Start();
 }
开发者ID:ryselis,项目名称:viktoro_viktorina,代码行数:7,代码来源:MainWindow.cs


示例19: MPXProcessor

 public MPXProcessor(ISharpControl control)
 {
     this._control = control;
       this._control.PropertyChanged += new PropertyChangedEventHandler(this.NotifyPropertyChangedHandler);
       this._fftTimer = new System.Windows.Forms.Timer();
       this._fftTimer.Tick += new EventHandler(this.fftTimer_Tick);
       this._fftTimer.Interval = 40;
       this._fftBins = 4096;
       this.InitFFTBuffers();
       this.BuildFFTWindow();
       this._spectrumAnalyzer = new SpectrumAnalyzer();
       this._spectrumAnalyzer.Dock = DockStyle.Fill;
       this._spectrumAnalyzer.Margin = new Padding(0, 0, 0, 0);
       this._spectrumAnalyzer.DisplayRange = 90;
       this._spectrumAnalyzer.EnableFilter = false;
       this._spectrumAnalyzer.EnableHotTracking = false;
       this._spectrumAnalyzer.EnableFrequencyMarker = false;
       this._spectrumAnalyzer.StepSize = 19000;
       this._spectrumAnalyzer.UseSmoothing = true;
       this._spectrumAnalyzer.SpectrumWidth = 100000;
       this._spectrumAnalyzer.Frequency = (long) (this._spectrumAnalyzer.SpectrumWidth / 2);
       this._spectrumAnalyzer.CenterFrequency = (long) (this._spectrumAnalyzer.SpectrumWidth / 2);
       this._spectrumAnalyzer.Attack = 0.9f;
       this._spectrumAnalyzer.Decay = 0.6f;
       this._spectrumAnalyzer.StatusText = "FM MPX Spectrum";
       this._spectrumAnalyzer.FrequencyChanged += new ManualFrequencyChangeEventHandler(this.spectrumAnalyzer_FrequencyChanged);
       this._spectrumAnalyzer.CenterFrequencyChanged += new ManualFrequencyChangeEventHandler(this.spectrumAnalyzer_CenterFrequencyChanged);
       this._spectrumAnalyzer.VisibleChanged += new EventHandler(this.spectrumAnalyzer_VisibleChanged);
       this._control.RegisterStreamHook((object) this, ProcessorType.FMMPX);
       this._control.RegisterFrontControl((UserControl) this._spectrumAnalyzer, (PluginPosition) Utils.GetIntSetting("zoomPosition", 1));
 }
开发者ID:zloiia,项目名称:sdrsrc,代码行数:31,代码来源:MPXProcessor.cs


示例20: Decode_Form

 public Decode_Form()
 {
     InitializeComponent();
     passwordTimer = new Timer();
     passwordTimer.Interval = 6000;
     passwordTimer.Tick += new EventHandler(PasswordTimeOver);
 }
开发者ID:stxy0509,项目名称:SexParty_Decode,代码行数:7,代码来源:DecodeForm.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Forms.ToolBar类代码示例发布时间:2022-05-26
下一篇:
C# Forms.TextBoxBase类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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