aboutsummaryrefslogtreecommitdiff
path: root/Histacom2/OS/Win95/Win95Apps/12padamsViruses/StartRunner95.cs
blob: 579f00195ac95c361ffa004d6b996ef9572e4ec8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Histacom2.Engine;
using System.Drawing.Text;
using static Histacom2.Engine.SaveSystem;
using Histacom2.OS.Win95;

namespace Histacom2.OS.Win95.Win95Apps._12padamsViruses
{
    public partial class StartRunner95 : UserControl
    {
        Point beginLocation;
        int taskbarLength;
        int xLocation;
        Timer moveStart = new Timer();
        private static PrivateFontCollection pfc = new PrivateFontCollection();
        Windows95 w = new Windows95();
        public StartRunner95()
        {
            InitializeComponent();
            pfc.AddFontFile(DataDirectory + "\\LeviWindows.ttf");
            label2.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            beginLocation = w.startbutton.Location;
            moveStart.Interval = 300;
            moveStart.Tick += MoveStart_Tick;

        }

        private void MoveStart_Tick(object sender, EventArgs e)
        {
            int taskbarWidth = w.taskbar.Size.Width;
            Random random = new Random();
            xLocation = random.Next(1, taskbarWidth);
            w.startbutton.Location = new Point(xLocation, w.startbutton.Location.Y);
        }

        private void classicButton1_Click(object sender, EventArgs e)
        {
            moveStart.Start();
        }

        private void StartRunner95_Load(object sender, EventArgs e)
        {
            
        }

        private void classicButton2_Click(object sender, EventArgs e)
        {
            moveStart.Stop();
            w.startbutton.Location = beginLocation;
        }

        private void classicButton3_Click(object sender, EventArgs e)
        {
            ParentForm.Close();
        }
    }
}