Advertisement
Guest User

Untitled

a guest
Jul 4th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13.     public partial class Form1 : Form {
  14.         private bool _dragging = false;
  15.         private Point _start_point = new Point(0, 0);
  16.         private int Interval;
  17.         private string Text;
  18.         private int messageSent;
  19.         private bool validKey;
  20.         private int[] hoverColor = new int[] {28, 28, 28};
  21.  
  22.  
  23.         private void Form1_KeyDown(object sender, KeyEventArgs e){
  24.         }
  25.         public Form1(){
  26.             InitializeComponent();
  27.         }
  28.  
  29.         private void Form1_Load(object sender, EventArgs e){
  30.         }
  31.  
  32.         //-------------------------------------------------------------------------------------------------------
  33.         //-------------------------------------------------------------------------------------------------------
  34.         //-------------------------------------------------------------------------------------------------------
  35.  
  36.         private void label1_Click(object sender, EventArgs e){
  37.             Close();
  38.         }
  39.  
  40.         private void label2_Click(object sender, EventArgs e){
  41.             this.WindowState = FormWindowState.Minimized;
  42.         }
  43.  
  44.         //-------------------------------------------------------------------------------------------------------
  45.         //-------------------------------------------------------------------------------------------------------
  46.         //-------------------------------------------------------------------------------------------------------
  47.  
  48.         private void panel3_MouseClick(object sender, MouseEventArgs e){
  49.             Close();
  50.         }
  51.  
  52.         //-------------------------------------------------------------------------------------------------------
  53.  
  54.         private void panel2_MouseClick(object sender, MouseEventArgs e){
  55.             this.WindowState = FormWindowState.Minimized;
  56.         }
  57.  
  58.         //-------------------------------------------------------------------------------------------------------
  59.         //-------------------------------------------------------------------------------------------------------
  60.         //-------------------------------------------------------------------------------------------------------
  61.  
  62.         private void panel4_MouseDown(object sender, MouseEventArgs e){
  63.             _dragging = true;
  64.             _start_point = new Point(e.X, e.Y);
  65.         }
  66.  
  67.         private void panel4_MouseUp(object sender, MouseEventArgs e){
  68.             _dragging = false;
  69.         }
  70.         private void panel4_MouseMove(object sender, MouseEventArgs e){
  71.             if (_dragging){
  72.                 Point p = PointToScreen(e.Location);
  73.                 Location = new Point(p.X - this._start_point.X, p.Y - this._start_point.Y);
  74.             }
  75.         }
  76.  
  77.         //-------------------------------------------------------------------------------------------------------
  78.  
  79.         private void pictureBox1_MouseDown(object sender, MouseEventArgs e){
  80.             _dragging = true;
  81.             _start_point = new Point(e.X, e.Y);
  82.         }
  83.  
  84.         private void pictureBox1_MouseUp(object sender, MouseEventArgs e){
  85.             _dragging = false;
  86.         }
  87.  
  88.         private void pictureBox1_MouseMove(object sender, MouseEventArgs e){
  89.             if (_dragging)
  90.             {
  91.                 Point p = PointToScreen(e.Location);
  92.                 Location = new Point(p.X - this._start_point.X, p.Y - this._start_point.Y);
  93.             }
  94.         }
  95.  
  96.         //-------------------------------------------------------------------------------------------------------
  97.  
  98.        
  99.         private void lblName_MouseDown(object sender, MouseEventArgs e){
  100.             _dragging = true;
  101.             _start_point = new Point(e.X, e.Y);
  102.         }
  103.  
  104.         private void lblName_MouseUp(object sender, MouseEventArgs e){
  105.             _dragging = false;
  106.         }
  107.  
  108.         private void lblName_MouseMove(object sender, MouseEventArgs e){
  109.             if (_dragging)
  110.             {
  111.                 Point p = PointToScreen(e.Location);
  112.                 Location = new Point(p.X - this._start_point.X, p.Y - this._start_point.Y);
  113.             }
  114.         }
  115.  
  116.         //-------------------------------------------------------------------------------------------------------
  117.         //-------------------------------------------------------------------------------------------------------
  118.         //-------------------------------------------------------------------------------------------------------
  119.  
  120.         private void panel5_MouseClick(object sender, MouseEventArgs e){
  121.             Help f1 = new Help();
  122.             f1.ShowDialog();
  123.         }
  124.  
  125.         private void label6_MouseClick(object sender, MouseEventArgs e){
  126.             Help f1 = new Help();
  127.             f1.ShowDialog();
  128.         }
  129.  
  130.         //-------------------------------------------------------------------------------------------------------
  131.         //-------------------------------------------------------------------------------------------------------
  132.         //-------------------------------------------------------------------------------------------------------
  133.  
  134.         private void buttonStart_Click(object sender, EventArgs e){
  135.             Interval = Convert.ToInt32(txtInterval.Text);
  136.             Text = txtText.Text;
  137.  
  138.             timerInterval.Interval = Interval;
  139.             timerInterval.Start();
  140.             if (timerInterval.Enabled){
  141.                 lblStatus.Text = "running";
  142.             }
  143.         }
  144.  
  145.         private void buttonStop_Click(object sender, EventArgs e){
  146.             timerInterval.Stop();
  147.  
  148.             lblStatus.Text = "idle";
  149.             messageSent = 0;
  150.             lblSent.Text = messageSent.ToString();
  151.         }
  152.  
  153.         private void timerInterval_Tick(object sender, EventArgs e){
  154.             SendKeys.Send(Text);
  155.             SendKeys.Send("{ENTER}");
  156.  
  157.             ++messageSent;
  158.             lblSent.Text = messageSent.ToString();
  159.         }
  160.  
  161.         //-------------------------------------------------------------------------------------------------------
  162.         //-------------------------------------------------------------------------------------------------------
  163.         //-------------------------------------------------------------------------------------------------------
  164.  
  165.  
  166.  
  167.         private void panel3_MouseHover(object sender, EventArgs e) {
  168.  
  169.             panel3.ForeColor = Color.FromArgb(
  170.                 255,
  171.                 255,
  172.                 255
  173.            );
  174.         }
  175.  
  176.         private void label1_MouseHover(object sender, EventArgs e) {
  177.  
  178.             panel3.ForeColor = Color.FromArgb(
  179.                 255,
  180.                 255,
  181.                 255
  182.             );
  183.         }
  184.     }
  185. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement