Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // KREATOR HASEŁ
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void trackBar1_Scroll(object sender, EventArgs e)
- {
- int a = trackBar1.Value;
- label4.Text = a.ToString();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- oblicz();
- }
- private void oblicz()
- {
- int a, b, c, d, e;
- a = textBox1.Text.Length;
- b = textBox2.Text.Length;
- c = textBox3.Text.Length;
- d = a + b + c;
- e = trackBar1.Value;
- if (d <= e)
- {
- int z;
- z = trackBar1.Value - d;
- Random rnd = new Random();
- int num = rnd.Next(1, 6);
- if (num == 1)
- {
- label4.Text = textBox1.Text + textBox2.Text + textBox3.Text;
- }
- else if (num == 2)
- {
- label4.Text = textBox2.Text + textBox1.Text + textBox3.Text;
- }
- else if (num == 3)
- {
- label4.Text = textBox2.Text + textBox3.Text + textBox1.Text;
- }
- else if (num == 4)
- {
- label4.Text = textBox3.Text + textBox2.Text + textBox1.Text;
- }
- else if (num == 5)
- {
- label4.Text = textBox1.Text + textBox3.Text + textBox2.Text;
- }
- else if (num == 6)
- {
- label4.Text = textBox3.Text + textBox1.Text + textBox2.Text;
- }
- for (int i = 0; i < z; i++)
- {
- Random rnd1 = new Random();
- int num1 = rnd1.Next(0, 9);
- label1.Text = label4.Text + num1.ToString();
- }
- MessageBox.Show(label4.Text);
- File.WriteAllText(@"Pulpit", label4.Text);
- }
- else
- {
- label4.Text = "Podane frazy maja wiecej liter niz wartosc na suwaku!";
- }
- }
- }
- }
- // NOTATNIK ; ZAPIS , ODCZYT , CZCIONKA, KOLOR CZCIONKI
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void zapiszJakoToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SaveFileDialog sv = new SaveFileDialog();
- sv.Filter = "Text Documents(*.txt)|*.txt|All Files(*.*)|*.*";
- if (sv.ShowDialog() == DialogResult.OK) // ZAPIS
- richTextBox1.SaveFile(sv.FileName, RichTextBoxStreamType.PlainText);
- }
- private void otwórzToolStripMenuItem_Click(object sender, EventArgs e)
- {
- OpenFileDialog op = new OpenFileDialog();
- if (op.ShowDialog() == DialogResult.OK)
- richTextBox1.LoadFile(op.FileName, RichTextBoxStreamType.PlainText); // OTWÓRZ
- this.Text = op.FileName;
- }
- private void czcionkaToolStripMenuItem_Click(object sender, EventArgs e)
- {
- FontDialog fd = new FontDialog();
- fd.Font = richTextBox1.SelectionFont; // CZCIONKA
- if (fd.ShowDialog() == DialogResult.OK)
- {
- richTextBox1.SelectionFont = fd.Font;
- }
- }
- private void backgroundColorToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ColorDialog cr = new ColorDialog(); //KOLOR TŁA
- if (cr.ShowDialog() == DialogResult.OK)
- {
- richTextBox1.BackColor = cr.Color;
- }
- }
- private void fontColorToolStripMenuItem_Click(object sender, EventArgs e)
- { // KOLOR CZCIONKI
- ColorDialog col = new ColorDialog();
- col.ShowDialog();
- richTextBox1.SelectionColor = col.Color;
- }
- private void nowyToolStripMenuItem_Click(object sender, EventArgs e)
- { // RESET TEKSTU
- richTextBox1.ResetText();
- }
- }
- }
- // PROGRAM WITANIA
- public partial class Form1 : Form
- {
- string imie;
- string przywitanie = "Witaj";
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- imie = textBox1.Text;
- MessageBox.Show(przywitanie);
- }
- private void powitanie1ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- przywitanie = "Witaj " + imie;
- }
- private void powitanie1ToolStripMenuItem1_Click(object sender, EventArgs e)
- {
- przywitanie = "Cześć " + imie;
- }
- private void powitanie1ToolStripMenuItem2_Click(object sender, EventArgs e)
- {
- przywitanie = "Dzień Dobry " + imie;
- }
- private void powitanie1ToolStripMenuItem3_Click(object sender, EventArgs e)
- {
- przywitanie = "Hello " + imie;
- }
- private void powitanie5ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- przywitanie = "Guten Tag " + imie;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement