コード例 #1
0
        public App()
        {
            this.Startup            += this.Application_Startup;
            this.Exit               += this.Application_Exit;
            this.UnhandledException += this.Application_UnhandledException;

            InitializeComponent();

            _vbscript = new VbscriptHost();
        }
コード例 #2
0
        private void MyButton_Click(object sender, RoutedEventArgs e)
        {
            VbscriptHost vbscript = ((App)Application.Current).VBScript;
            ScriptScope  scope    = vbscript.CreateScope();

            scope.SetVariable("page", this);
            //this.MyButton.Content = "Clicked";
            string       code     = "page.MyButton.Content = \"Clicked\"";
            CompiledCode compiled = vbscript.Compile(code);

            compiled.Execute(scope);
        }