设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 2371|回复: 9
打印 上一主题 下一主题

【作业】01课-sballimiao

[复制链接]
跳转到指定楼层
1#
发表于 2014-3-6 20:57:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
第二题没能隐藏,不知道做得对不对,也提交试试

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

评分

参与人数 1V币 +1 收起 理由
faunus + 1 (V币)课程报名、录像学习、代码练习跟贴.

查看全部评分

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2014-3-7 22:49:07 | 只看该作者
请上传源代码,或整个工程的文件夹!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
3#
 楼主| 发表于 2014-3-8 08:32:29 | 只看该作者
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using Office = Microsoft.Office.Core;

namespace vsto第一课作业
{
    public partial class ThisAddIn
    {
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            System.Windows.Forms.MessageBox.Show("VSTO第一课作业");
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
4#
 楼主| 发表于 2014-3-8 08:33:31 | 只看该作者
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;

namespace VSTO第一课作业2
{
    public partial class Ribbon1
    {
        private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
        {

        }

        private void button1_Click(object sender, RibbonControlEventArgs e)
        {
            System.Diagnostics.Process.Start("notepad.exe");

        }
    }
}
5#
 楼主| 发表于 2014-3-8 08:34:06 | 只看该作者
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;

namespace VSTO第一课作业3
{
    public partial class Ribbon1
    {
        private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
        {

        }

        private void checkBox1_Click(object sender, RibbonControlEventArgs e)
        {
            try
            {System.Diagnostics.Process.Start("http://yy.com/91283328/91283328?from");


            }
            catch (Exception)
            {
                System.Diagnostics.Process.Start("yy://pd-[sid=91283328&subid=2175343697]");

               
            }
        }
    }
}
6#
发表于 2014-3-8 08:42:24 | 只看该作者
没做到后台运行
7#
 楼主| 发表于 2014-3-8 13:12:42 | 只看该作者
抄来的,还不明白意思
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;

namespace VSTO第一课作业2新
{
    public partial class Ribbon1
    {
        private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
        {

        }

        private void button1_Click(object sender, RibbonControlEventArgs e)
        {
            System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
            System.Diagnostics.ProcessStartInfo myProStartInfo = new System.Diagnostics.ProcessStartInfo("notepad.exe");
            myProcess.StartInfo = myProStartInfo;
            myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
            myProcess.Start();
        }
    }
}
8#
发表于 2014-3-10 11:57:15 | 只看该作者

9#
 楼主| 发表于 2014-3-11 17:04:08 | 只看该作者
后台打开记事本程度,西西老师的答案,贴这儿做个记录
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Word = Microsoft.Office.Interop.Word;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Tools.Word;
using System.Diagnostics;

namespace 后台打开记事本
{
    public partial class ThisAddIn
    {
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {   Process pcProcess=new Process();
            pcProcess.StartInfo.FileName="notepad";
            pcProcess.StartInfo.WindowStyle=ProcessWindowStyle.Hidden;
            pcProcess.Start();


        }

        
10#
 楼主| 发表于 2014-3-13 22:54:06 | 只看该作者
CheckBox作业记录
namespace 第一课作业3
{
    public partial class Ribbon1
    {
        private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
        {

        }

        private void checkBox1_Click(object sender, RibbonControlEventArgs e)
        {
            if (this.checkBox1.Checked)//如果勾选
            {
                System.Diagnostics.Process.Start("http://yy.com/91283328/2175343697?from=");//打开网页YY
            }
            else
            {
                System.Diagnostics.Process.Start("yy://pd-[sid=91283328&subid=2175343697]");//打开软件YY
            }


        }
    }
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-4-29 11:42 , Processed in 0.101346 second(s), 35 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表