그냥 Windows 창 가지고 놀기 -_-
using System;
using System.Windows.Forms;
using System.Drawing;
class QuizForm : Form
{
QuizForm()
{
this.Text = "Window 창 가지고 놀기 By RyuiSaka";
this.BackColor = Color.BlanchedAlmond;
this.Width *= 2;
this.Height /= 2;
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Cursor = Cursors.Hand;
this.StartPosition = FormStartPosition.CenterScreen;
}
static void Main()
{
QuizForm quizForm = new QuizForm();
Application.Run(quizForm);
}
protected override void OnKeyDown(KeyEventArgs e)
{
switch(e.KeyCode)
{
case Keys.Left :
if(e.Control) this.Width = this.Width - 5;
else this.Location = new Point(this.Location.X - 5, this.Location.Y);
break;
case Keys.Right :
if(e.Control) this.Width = this.Width + 5;
else this.Location = new Point(this.Location.X + 5, this.Location.Y);
break;
case Keys.Up :
if(e.Control) this.Height = this.Height - 5;
else this.Location = new Point(this.Location.X, this.Location.Y - 5);
break;
case Keys.Down :
if(e.Control) this.Height = this.Height + 5;
else this.Location = new Point(this.Location.X, this.Location.Y + 5);
break;
case Keys.Enter :
if (e.Alt) this.WindowState = FormWindowState.Maximized;
else if (e.Control) this.WindowState = FormWindowState.Minimized;
else if (e.Shift) this.WindowState = FormWindowState.Normal;
break;
}
}
}