. NET Language app development platform--smobiler Learning log: How to quickly implement timer timer function

Source: Internet
Author: User

Front: Smobiler is a development platform that uses. NET language to develop apps in the VS environment, perhaps more convenient than Xamarin

First, the target style

We want to achieve the effect in the following actions:

1. Drag a Timer control, a TextBox control, a button control, a label control, and an image control to the form interface from "Smobiler components" on the toolbar

Tick events for 2.Timer controls
vb:    private sub timer1_tick (sender as object, e as  EventArgs)  handles timer1. tick       me.textbox1.text =  (Convert.ToInt32 ( Me.textBox1.Text.ToString ())  - 1). ToString ()    end sub 
C #: private void Timer1_Tick (object sender, EventArgs e) {this.textBox1.Text = (Convert.ToInt32 (this.textBox1.Te Xt. ToString ())-1).          ToString (); }

Note: Call the Timer control

The TextChanged event of 3.TextBox
vb:   private sub textbox1_textchanged (Sender as object, e as  eventargs)  handles textbox1.textchanged        if  Me.textBox1.Text =  "0"  Then            timer1. Stop ()        Else            timer1. Start ()        end if   end sub 
c#:   private void textbox1_textchanged (Object sender, eventargs e)    {        if (this.textbox1.text == "0")         {           timer1. Stop ();       }       else        {           timer1. Start ();        }   } 

Note: Determine the condition to select the start timer or stop timer

The Click event for the 4.Button control
Vb:private Sub button1_click (sender as Object, e as EventArgs) Handles button1. Click Me.textBox1.Text = "the" End Sub
C #: private void Button1_Click (object sender, EventArgs e) {this.textBox1.Text = "60"; }
5. Modify the properties of the Timer Control A.interval property

The time interval for triggering the tick event, in seconds, the default setting is "1", i.e. the interval time is 1 seconds, see;

Second, the mobile phone effect display

The effect is displayed when the button is pressed:


. NET Language app development platform--smobiler Learning log: How to quickly implement timer timer function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.