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
| using System;
using System.Collections.Generic;
using System.Windows.Forms;
using MYCLASS;
namespace DemoForm
{
public class MainClass
{
public void MenuProc(object sender, EventArgs e)
{
MessageBox.Show("Méthode 1 !");
}
}
static class Program
{
/// <summary>
/// Point d'entrée principal de l'application.
/// </summary>
[STAThread]
static void Main()
{
int iError;
string sMainWindow = "Main";
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// create main menu
iError = MyClass.MenuAdd(sMainWindow, "m11", 1, 1, "File", "");
iError = MyClass.MenuAdd(sMainWindow, "m12", 1, 2, "&Open", "");
iError = MyClass.MenuAdd(sMainWindow, "m13", 1, 3, "&Save", "");
iError = MyClass.MenuAdd(sMainWindow, "m14", 1, 4, "&Quit", "");
// create main window
MyClass.WindowCreate(sMainWindow, 0, 0, 0, 0, "name=DemoForm v1.0", MainClass.MenuProc); // ERREUR ICI
}
}
} |
Partager