C# dasturlash tilida sekundomer dasturi


Download 1.07 Mb.
Sana29.06.2022
Hajmi1.07 Mb.
#780782
Bog'liq
SHOHJAXON
Hosildorlik, 1-маъруза-2019, 1-маъруза-2019, Gramm usulida bo, oyin bogcha yoshidagi bolalarda yetakchi faoliyat sifatida, maktabgacha yoshidagi bolalarda oyinning roli, 05. Литература как вид искусства. Художественная литература, 1481109262 kimyoviy-termodinamika-asoslari arxiv.uz (1), SAVOL, kichik maktab yoshidagi oquvchilar xulq atvorining psixologik xususiyatlari, MAKTABGACHA YOSH DAVRIDA PSIXIK RIVOJLANISH XUSUSIYATLARI, Glossariy Biozararlanish, ijtimoiy psixologiya, 2 маърузаTermodinamikaning ikkinchi va uchinchi qonunlari, 2 маърузаTermodinamikaning ikkinchi va uchinchi qonunlari

C# dasturlash tilida sekundomer dasturi
Biz sekundomer dasturini tuzish uchun visual studio 2012 dan foydalandik. VISUAL DASTURIGA KIRAMIZ.



Bu oynadan NEW PROJEKT... NI bosamiz.



C# tilini tanlab (WINDOWS FORM APPLICATION) tanlaymiz.


FORM 1 ga 1 ta (button va label) tashaymiz.



BUTTON ni chertib ichiga dasturni yozamiz.


dasturlarni yozib bo'lgach. START tugmasini bosamiz.


DASTUR ILOVASI
namespace sekundomer
{
public partial class Form1 : Form
{
DateTime date;
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
date = DateTime.Now;

Timer timer = new Timer();
timer.Interval = 10;
timer.Tick += new EventHandler(tickTimer);
timer.Start();


}

private void tickTimer(object sender,EventArgs e)
{
long tick = DateTime.Now.Ticks - date.Ticks;
DateTime stopWatch = new DateTime();

stopWatch = stopWatch.AddTicks(tick);
label1.Text = String.Format("{0:HH:ss:ff}", stopWatch);
}
}
}



Download 1.07 Mb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2023
ma'muriyatiga murojaat qiling