Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Vezba_07_2017_Zad3
- {
- public partial class Form1 : Form
- {
- DateTime dt;
- public Form1()
- {
- InitializeComponent();
- }
- // s tim sto mora na svaki radio button da se postavi da je ova funkcija handler
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- if (radioButton1.Checked)
- {
- label2.Text = radioButton1.Text;
- }
- if (radioButton2.Checked)
- {
- label2.Text = radioButton2.Text;
- }
- if (radioButton3.Checked)
- {
- label2.Text = radioButton3.Text;
- }
- if (radioButton4.Checked)
- {
- label2.Text = radioButton4.Text;
- }
- if (radioButton5.Checked)
- {
- label2.Text = radioButton5.Text;
- }
- if (radioButton6.Checked)
- {
- label2.Text = radioButton6.Text;
- }
- if (radioButton7.Checked)
- {
- label2.Text = radioButton7.Text;
- }
- if (radioButton8.Checked)
- {
- label2.Text = radioButton8.Text;
- }
- if (radioButton9.Checked)
- {
- label2.Text = radioButton9.Text;
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- timer1.Start();
- dt = DateTime.Now;
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- label3.Text = DateTime.Now.ToLongTimeString();
- if (radioButton1.Checked)
- {
- label4.Text = DateTime.Now.AddHours(-10).ToLongTimeString();
- }
- else if (radioButton2.Checked)
- {
- label4.Text = DateTime.Now.AddHours(-7).ToLongTimeString();
- }
- else if (radioButton3.Checked)
- {
- label4.Text = DateTime.Now.AddHours(-1).ToLongTimeString();
- }
- else if (radioButton4.Checked)
- {
- label4.Text = DateTime.Now.AddHours(0).ToLongTimeString();
- }
- else if (radioButton5.Checked)
- {
- label4.Text = DateTime.Now.AddHours(0).ToLongTimeString();
- }
- else if (radioButton6.Checked)
- {
- label4.Text = DateTime.Now.AddHours(+2).ToLongTimeString();
- }
- else if (radioButton7.Checked)
- {
- label4.Text = DateTime.Now.AddHours(+6).ToLongTimeString();
- }
- else if (radioButton8.Checked)
- {
- label4.Text = DateTime.Now.AddHours(+7).ToLongTimeString();
- }
- else if (radioButton9.Checked)
- {
- label4.Text = DateTime.Now.AddHours(+9).ToLongTimeString();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement