//NoName->System 으로 변경//NoName->System 으로 변경//NoName->System 으로 변경//NoName->System 으로 변경//NoName->System 으로 변경
using NoName;
using NoName.ComponentModel;
using NoName.Windows.Forms;
using NoName.Drawing;
using NoName.Drawing.Drawing2D;
using NoName.Timers;
class Program
{
public static void Main(string[] args)
{
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
if(args.Length==1)
{
if(args[0]=="E") Application.Run(new OtherManageCls());
}
}
}
class OtherManageCls : Form
{
int ____hatchstyle=0;
const int WM_KEYDOWN = 0x0100, WM_KEYUP = 0x0101, WM_CHAR = 0x0102, WM_SYSKEYDOWN = 0x0104, WM_SYSKEYUP = 0x0105, WM_PAINT = 0x000f, WM_SIZE = 0x0005;
public OtherManageCls()
{
this.Width = 700;
this.Height = 300;
}
void draw()
{
int xx,yy,width,height;
xx = this.Width / 4;
yy = this.Height / 4;
width = this.Width / 4 * 2;
height = this.Height / 4;
DrawBackground(0,0,this.Width,this.Height,____hatchstyle);
DrawForeground(xx,yy,width,height,____hatchstyle);
this.Text = "Time:[" + DateTime.Now.ToString() + "]" + ">>HatchStyle Number:[" + ____hatchstyle.ToString("00") + "]";
}
void DrawForeground(int xx, int yy, int width, int height, int ____hatchstyle)
{
HatchStyle hs = (HatchStyle)____hatchstyle;
Brush myBrush = new HatchBrush(hs, NoName.Drawing.Color.SteelBlue);
Pen myPen = new Pen(NoName.Drawing.Color.LightGray, 1);
NoName.Drawing.Graphics formGraphics;
formGraphics = this.CreateGraphics();
formGraphics.FillRectangle(myBrush, new Rectangle(xx, yy, width, height));
formGraphics.DrawRectangle(myPen , xx, yy, width, height);
}
void DrawBackground(int xx, int yy, int width, int height, int ____hatchstyle)
{
HatchStyle hs = (HatchStyle)____hatchstyle;
Brush myBrush = new HatchBrush(hs, NoName.Drawing.Color.LightYellow);
Pen myPen = new Pen(NoName.Drawing.Color.LightGray, 1);
NoName.Drawing.Graphics formGraphics;
formGraphics = this.CreateGraphics();
formGraphics.FillRectangle(myBrush, new Rectangle(xx, yy, width, height));
formGraphics.DrawRectangle(myPen , xx, yy, width, height);
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
{
switch (keyData.ToString())
{
case "Return" :
DialogResult dialogResult = MessageBox.Show("Quit OK!!", "Inform",
MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
if (dialogResult == DialogResult.OK) Application.Exit();
break;
case "Right" :
____hatchstyle += 1;
if(____hatchstyle == 53) ____hatchstyle=0;
break;
case "Left" :
____hatchstyle -= 1;
if(____hatchstyle == -1) ____hatchstyle=52;
break;
default:
break;
}
draw();
}
return base.ProcessCmdKey(ref msg, keyData);
}
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
try
{
switch(m.Msg)
{
case WM_PAINT :
draw();
break;
default:
break;
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
'c# 언어 > 중급과정' 카테고리의 다른 글
Data communication between Proesses!! (0) | 2022.03.25 |
---|---|
SendMessage/FindWindow/Snd/Rcv Str (0) | 2022.03.15 |
HatchStyle,HatchBrush,Pen (0) | 2022.03.08 |
Hexa 4가지 항목으로 점수계산 로직 (0) | 2022.03.06 |
LINQ 쿼리 소개(C#) (0) | 2022.02.23 |