Ejemplo n.º 1
0
        static void Main()
        {
            CreateRes();

            //读入主题包
            byte[] theme = File.ReadAllBytes(".\\Default.ext");

            theApp = new ExApp(theme);
            skin   = new ExSkin(null, null, "你好世界", 0, 0, 600, 400,
                                EWS_BUTTON_CLOSE | EWS_BUTTON_MIN | EWS_CENTERWINDOW | EWS_HASICON |
                                EWS_TITLE | EWS_MOVEABLE | EWS_MAINWINDOW, 0, 0, 0, WndProc
                                );

            if (skin.Validate)
            {
                TestCustomCtrl.RegisterControl();
                //设置背景色
                skin.SetLong(EWL_CRBKG, Color.Blue.ToArgb());

                //ExBaseCtrl ctrl1 = new ExBaseCtrl(skin, "Button", "你好", 50, 50, 200, 35);
                ExButton btn1 = new ExButton(skin, "你好", 50, 50, 150, 40);

                byte[]   img  = File.ReadAllBytes(".\\Res\\bkg.png");
                ExStatic img1 = new ExStatic(skin, img, 50, 110, 300, 200);
                img1.SetBackgroundPlayState(true, false, false);

                ExEdit edit1 = new ExEdit(img1, "测试", 25, 25, 100, 30);

                TestCustomCtrl custom = new TestCustomCtrl(skin, "abc", 360, 110, 50, 50);


                //挂接事件
                btn1.HandleEvent(NM_CLICK,
                                 //lambda delegate
                                 (IntPtr hObj, int nID, int nCode, int wParam, int lParam) =>
                {
                    ExMessageBox.Show(new ExControl(hObj), "单击按钮" + skin.Text, btn1.ClassName, MB_ICONINFORMATION, 0);

                    btn1.Text = "测试";

                    return(false);
                }
                                 );

                //显示
                skin.Visible = true;

                //运行程序
                theApp.Run();
            }
        }
Ejemplo n.º 2
0
 public ExCanvas(ExSkin skin, int width, int height, int dwFlags)
 {
     m_hCanvas = (IntPtr)ExAPI._canvas_createfromexdui(skin.Handle, width, height, dwFlags);
 }