Timer timer = new Timer((obj) =>
{
Console.WriteLine("Hello");
});
timer.Change(0, 1000);
Thread.CurrentThread.Suspend();
Random rand = new Random();
Mas = rand.Next(1, 7)+6;
label6.Text = Mas.ToString();
Vin = rand.Next(2, 13) + 12;
label7.Text = Vin.ToString();
Ud = rand.Next(1, 7) + 6;
label8.Text = Ud.ToString();
namespace program1
{
class Program
{
static int Main(string[] args)
{
try
{
if (args.Length != 0)
{
foreach (string s in args)
{
Console.WriteLine(s);
}
}
else
{
Console.WriteLine("Возникла ошибочка!");
}
}
catch (DivideByZeroException ex)
{
return 3;
}
catch (FormatException ex)
{
return 2;
}
catch (Exception ex)
{
return 1;
}
}
}
}
TimerMove.Interval = 10;
TimerMove.Start();
private void button1_Click(object sender, EventArgs e)
{
var form = new Form1();
form.Shown += form_Shown;
form.Show();
}
void form_Shown(object sender, EventArgs e)
{
MessageBox.Show("Test");
}
double d = double.Parse("1,1");
Console.WriteLine("Value of d: {0}", d);
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
notifyIcon1.Visible = !notifyIcon1.Visible;
}
private void button2_Click(object sender, EventArgs e)
{
Form2 a = new Form2(notifyIcon1);
Visible = false;
a.ShowDialog();
Visible = true;
}
}
}
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
NotifyIcon ico;
public Form2(NotifyIcon ico)
{
this.ico = ico;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ico.Visible = !ico.Visible;
}
}
}