PCB Genesis指令碼C#使用WPF表單實現方法

來源:互聯網
上載者:User

標籤:rop   pre   ini   main   end   system   .com   run   圖片   

用C#寫指令碼做UI介面基本上都是用WinForm介面,如果想製作很漂亮動態介面用WPF介面挺不錯的選擇,

這裡介紹如何使用控制台程式調用WPF視窗

 

一.方法一

    在控制台程式中,通過Main方法啟動WPF視窗 

  App app = new App();  app.Run(new MainWindow());

二.方法二

    通過Form視窗啟動另外一個WPF視窗

  private void Form1_Load(object sender, EventArgs e)        {            this.Hide();            this.WindowState = FormWindowState.Minimized;            Window wpfwindow = new WPF表單.MainWindow();            ElementHost.EnableModelessKeyboardInterop(wpfwindow);            WindowInteropHelper helper = new WindowInteropHelper(wpfwindow);            helper.Owner = this.Handle;            wpfwindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;            wpfwindow.ShowDialog();            System.Windows.Forms.Application.Exit();        }

 

三.說明:  

            WPF視窗必須在另外一個程式集

 

四.WPF效果:

     來一個變形按鈕

 

PCB Genesis指令碼C#使用WPF表單實現方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.