Office中国论坛/Access中国论坛

标题: 【作业】01课-Jiakun2014 [打印本页]

作者: Jiakun2014    时间: 2014-3-5 04:45
标题: 【作业】01课-Jiakun2014
代码如下:
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Office.Tools.Ribbon;
  6. using System.Diagnostics;

  7. namespace WordAddIn
  8. {
  9.     public partial class TestRibbon
  10.     {
  11.         private void TestRibbon_Load(object sender, RibbonUIEventArgs e)
  12.         {

  13.         }

  14.         private void button1_Click(object sender, RibbonControlEventArgs e)
  15.         {

  16.             Process myProcess = new Process();
  17.             ProcessStartInfo myProStartInfo = new ProcessStartInfo("notepad.exe");
  18.             myProcess.StartInfo = myProStartInfo;
  19.             myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  20.             myProcess.Start();

  21.         }

  22.         private void chkYY_Click(object sender, RibbonControlEventArgs e)
  23.         {
  24.             if (chkYY.Checked)
  25.             {
  26.                 Process.Start("http://yy.com/91283328/91283328?from=769333290");
  27.             }
  28.             else {
  29.                 try
  30.                 {
  31.                     Process.Start("yy://pd-[sid=91283328&subid=2175343697]");
  32.                 }
  33.                 catch {
  34.                     System.Windows.Forms.MessageBox.Show("No YY Installed.");
  35.                 }
  36.             }

  37.         }
  38.     }
  39. }
复制代码


动画效果:

[attach]53323[/attach]
作者: 紫电    时间: 2014-3-7 23:18
[attach]53396[/attach]
符合题意,正确





欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3