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 WindowsFormsApplication1
- {
- public partial class Form1 : Form {
- private bool _dragging = false;
- private Point _start_point = new Point(0, 0);
- private int Interval;
- private string Text;
- private int messageSent;
- private bool validKey;
- private int[] hoverColor = new int[] {28, 28, 28};
- private void Form1_KeyDown(object sender, KeyEventArgs e){
- }
- public Form1(){
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e){
- }
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- private void label1_Click(object sender, EventArgs e){
- Close();
- }
- private void label2_Click(object sender, EventArgs e){
- this.WindowState = FormWindowState.Minimized;
- }
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- private void panel3_MouseClick(object sender, MouseEventArgs e){
- Close();
- }
- //-------------------------------------------------------------------------------------------------------
- private void panel2_MouseClick(object sender, MouseEventArgs e){
- this.WindowState = FormWindowState.Minimized;
- }
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- private void panel4_MouseDown(object sender, MouseEventArgs e){
- _dragging = true;
- _start_point = new Point(e.X, e.Y);
- }
- private void panel4_MouseUp(object sender, MouseEventArgs e){
- _dragging = false;
- }
- private void panel4_MouseMove(object sender, MouseEventArgs e){
- if (_dragging){
- Point p = PointToScreen(e.Location);
- Location = new Point(p.X - this._start_point.X, p.Y - this._start_point.Y);
- }
- }
- //-------------------------------------------------------------------------------------------------------
- private void pictureBox1_MouseDown(object sender, MouseEventArgs e){
- _dragging = true;
- _start_point = new Point(e.X, e.Y);
- }
- private void pictureBox1_MouseUp(object sender, MouseEventArgs e){
- _dragging = false;
- }
- private void pictureBox1_MouseMove(object sender, MouseEventArgs e){
- if (_dragging)
- {
- Point p = PointToScreen(e.Location);
- Location = new Point(p.X - this._start_point.X, p.Y - this._start_point.Y);
- }
- }
- //-------------------------------------------------------------------------------------------------------
- private void lblName_MouseDown(object sender, MouseEventArgs e){
- _dragging = true;
- _start_point = new Point(e.X, e.Y);
- }
- private void lblName_MouseUp(object sender, MouseEventArgs e){
- _dragging = false;
- }
- private void lblName_MouseMove(object sender, MouseEventArgs e){
- if (_dragging)
- {
- Point p = PointToScreen(e.Location);
- Location = new Point(p.X - this._start_point.X, p.Y - this._start_point.Y);
- }
- }
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- private void panel5_MouseClick(object sender, MouseEventArgs e){
- Help f1 = new Help();
- f1.ShowDialog();
- }
- private void label6_MouseClick(object sender, MouseEventArgs e){
- Help f1 = new Help();
- f1.ShowDialog();
- }
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- private void buttonStart_Click(object sender, EventArgs e){
- Interval = Convert.ToInt32(txtInterval.Text);
- Text = txtText.Text;
- timerInterval.Interval = Interval;
- timerInterval.Start();
- if (timerInterval.Enabled){
- lblStatus.Text = "running";
- }
- }
- private void buttonStop_Click(object sender, EventArgs e){
- timerInterval.Stop();
- lblStatus.Text = "idle";
- messageSent = 0;
- lblSent.Text = messageSent.ToString();
- }
- private void timerInterval_Tick(object sender, EventArgs e){
- SendKeys.Send(Text);
- SendKeys.Send("{ENTER}");
- ++messageSent;
- lblSent.Text = messageSent.ToString();
- }
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------
- private void panel3_MouseHover(object sender, EventArgs e) {
- panel3.ForeColor = Color.FromArgb(
- 255,
- 255,
- 255
- );
- }
- private void label1_MouseHover(object sender, EventArgs e) {
- panel3.ForeColor = Color.FromArgb(
- 255,
- 255,
- 255
- );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement