/*
*상속안할경우 나오는 에러메세지*/
Microsoft (R) Visual C# Compiler version 4.8.4084.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.
This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
ex12.cs(18,26): error CS0115: 'WindowsFrmManage.ProcessCmdKey(ref NoName.Windows.Forms.Message,
NoName.Windows.Forms.Keys)': 재정의할 적절한 메서드를 찾을 수 없습니다.
ex12.cs(40,26): error CS0115: 'WindowsFrmManage.WndProc(ref NoName.Windows.Forms.Message)': 재정의할 적절한 메서드를 찾을 수 없습니다.
using NoName;
using NoName.Windows.Forms;
class Program
{
public static void Main(string[] args)
{
Application.Run(new WindowsFrmManage());
}
}
class WindowsFrmManage
{
public WindowsFrmManage() {}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
const int WM_KEYDOWN = 0x0100, WM_KEYUP = 0x0101, WM_CHAR = 0x0102, WM_SYSKEYDOWN = 0x0104, WM_SYSKEYUP = 0x0105, WM_PAINT = 0x000f, WM_SIZE = 0x0005;
if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
{
switch (keyData.ToString())
{
case "Down" :
break;
case "Escape" :
Application.Exit();
break;
default:
break;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}
protected override void WndProc(ref Message m)//sdw_mh12e
{
const int WM_KEYDOWN = 0x0100, WM_KEYUP = 0x0101, WM_CHAR = 0x0102, WM_SYSKEYDOWN = 0x0104, WM_SYSKEYUP = 0x0105, WM_PAINT = 0x000f, WM_SIZE = 0x0005;
base.WndProc(ref m);
switch(m.Msg)
{
case WM_PAINT :
break;
default:
break;
}
}
}
'c# 언어 > 초급과정' 카테고리의 다른 글
Tris Width:Height(7:4), 기준:this.Height - this.ClientRectangle.Height (0) | 2022.03.28 |
---|---|
1Minute 후에 프로그램 종료하는 간단 예제 (0) | 2022.03.28 |
Form상속의 극단적인 예 (0) | 2022.03.18 |
다형성(polymorphism)은 무엇인가요? (0) | 2022.03.17 |
Form상속 (0) | 2022.03.17 |