SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Hi i need help for my school homework(Timer/Delay problem)

Last post 04-21-2017 4:28 PM by lucwuyts. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-21-2017 1:21 AM

    Hi i need help for my school homework(Timer/Delay problem)

    Hello im having a problem whit this code i dont now how to use the Timer

     

    The idea is when you click the main boton the background change in colors (Blue-red) 50 times

    i do this code but i dont now how to add a timer

    /*
     * Created by SharpDevelop.
     * User: Ain
     * Date: 20/04/2017
     * Time: 19:49
     * 
     * To change this template use Tools | Options | Coding | Edit Standard Headers.
     */
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Windows.Forms;

    namespace nuevo
    {

        public partial class MainForm : Form
        {
            public MainForm()
            {
                //
                // The InitializeComponent() call is required for Windows Forms designer support.
                //
                InitializeComponent();
                
                //
                // TODO: Add constructor code after the InitializeComponent() call.
                //
            }
            void Button1Click(object sender, EventArgs e)
            {
                for (int i = 0; i < 50; i++) {
                    BackColor = Color.Red;
                    // i think i need to put the timer here
                    BackColor = Color.Red;
                    
                }
            }
            
        }

     

     

    i try to go to desing/tools/Windows Form < and the end of the list there is a "Timer" but i dont have idea how to use it, i try to search documentation but all i found is sharpdevelop 1.0 :(

    Filed under: ,
  • 04-21-2017 4:28 PM In reply to

    Re: Hi i need help for my school homework(Timer/Delay problem)

    You have put your timer on the form.

    It will be visible underneath the form (I think, because i did not use sharpdevelop for a long time)

    select the timer

    in the properties window, you can setup the timer-period, and in the events tab, you can create a interval event (i think dubbel clicking the timer on the form adds this event too)

     

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.