Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- using System.Drawing;
- namespace Fitt_s_Law
- {
- class Startscherm : Form
- {
- Button beginBtn = new Button();
- Button randomBtn = new Button();
- Random plaats = new Random();
- //int plaatsx = 50;
- //int plaatsy = 50;
- public Startscherm() {
- //Opmaak startscherm
- this.Text = "Fitts' Law - Startscherm";
- this.Size = new Size(500, 500);
- beginBtn.Location = new Point(230, 250);
- randomBtn.Location = new Point(210, 250);
- //Aanroepen inhoud startscherm
- this.Paint += this.StartGame;
- }
- public void StartGame(object obj, PaintEventArgs pea)
- {
- //Random locatie aanmaken
- //Aanmaken startknop
- beginBtn.Text = "je moeder";
- //Aanmaken randomBtn
- randomBtn.Text = "Klik mij!";
- //Opmaak van beginBtn
- beginBtn.BackColor = Color.White;
- beginBtn.FlatStyle = FlatStyle.Flat;
- beginBtn.FlatAppearance.BorderColor = Color.Maroon;
- beginBtn.Location = new Point(230, 250);
- //Aanroepen acties na het klikken op beginBtn
- beginBtn.Click += beginBtn_Click;
- //Opmaak van randomBtn
- randomBtn.BackColor = Color.White;
- randomBtn.FlatStyle = FlatStyle.Flat;
- randomBtn.FlatAppearance.BorderColor = Color.Maroon;
- randomBtn.Location = new Point(210, 250);
- //Aanroepen acties na het klikken op randomBtn
- randomBtn.Click += randomBtn_Click;
- //Verbergen van randomBtn tijdens opstart form
- randomBtn.Hide();
- //Toevoegen van knoppen aan scherm
- this.Controls.Add(beginBtn);
- this.Controls.Add(randomBtn);
- // beginBtn.Click += beginBtn_Click;
- }
- public void beginBtn_Click(object sender, EventArgs e)
- {
- Console.WriteLine("PEPERAGE");
- beginBtn.Hide();
- randomBtn.Show();
- //Random plaats = new Random();
- //int plaatsx = plaats.Next(0, 500);
- //int plaatsy = plaats.Next(0, 500);
- //randomBtn.Location = new Point(50, 50);
- //randomBtn.Show();
- }
- public void randomBtn_Click(object sender, EventArgs e)
- {
- Console.WriteLine("pepeace");
- randomBtn.Hide();
- beginBtn.Show();
- // beginBtn.Show();
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- //Aanmaken en opstarten van startscherm
- Startscherm startscherm;
- startscherm = new Startscherm();
- Application.Run(startscherm);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement