Autorius Tema: Juodraščiai  (Skaityta 94 kartus)

Neprisijungęs Kalnų karalius

  • Naujokas
  • *
  • Įrašai: 69
  • Karma: +0/-0
    • Žiūrėti profilį
Juodraščiai
« Įrašytas: 2013-08-12 20:52:07 pm »
Užsirašau, kad įvykus katastrofinei avarijai kompiuteriui, neprasmegtų mano kodai :D

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Lisense_code
{
    public partial class Form1 : Form
    {
        int TogMove;
        int MValueX;
        int MvalueY;
        int resized = 0;
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            textBox1.MaxLength = 4;
            textBox2.MaxLength = 4;
            textBox3.MaxLength = 4;
            textBox4.MaxLength = 4;
           
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (textBox1.TextLength == 4)
            {
                textBox2.Focus();
            }
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            if (textBox2.TextLength == 4)
            {
                textBox3.Focus();
            }
            else if (textBox2.TextLength == 0)
            {
                textBox1.Focus();
            }
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            if (textBox3.TextLength == 4)
            {
                textBox4.Focus();
            }
            else if (textBox3.TextLength == 0)
            {
                textBox2.Focus();
            }
        }

        private void pb_MouseDown_1(object sender, MouseEventArgs e)
        {
            TogMove = 1;
            MValueX = e.X;
            MvalueY = e.Y;
        }

        private void pb_MouseMove_1(object sender, MouseEventArgs e)
        {
            if (TogMove == 1)
            {
                this.SetDesktopLocation(MousePosition.X - MValueX, MousePosition.Y - MvalueY);
            }
        }

        private void pb_MouseUp_1(object sender, MouseEventArgs e)
        {
            TogMove = 0;
        }

        private void textBox4_TextChanged(object sender, EventArgs e)
        {
            if (textBox4.TextLength == 0)
            {
                textBox3.Focus();
            }
        }

        private void label7_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void label8_Click(object sender, EventArgs e)
        {
            if (resized == 0)
            {
                this.Width = 800;
                this.Height = 600;
                resized = 1;
            }
            else
            {
                this.Width = 550;
                this.Height = 190;
                resized = 0;
            }
        }
    }
}

Manualai.lt Forumas

Juodraščiai
« Įrašytas: 2013-08-12 20:52:07 pm »