设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 3566|回复: 6

【作业】@VSTO易#初级班01期#第02课

[复制链接]

点击这里给我发消息

发表于 2014-3-8 21:37:28 | 显示全部楼层 |阅读模式
①插件用P或W实现
②动态数据,改用Dictionary存储
③尝试使用除RibbonMenu以外的其它控件,实现该功能,如RibbonGallery


大家加油哦

本帖子中包含更多资源

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

x

点击这里给我发消息

发表于 2014-3-8 21:41:22 | 显示全部楼层
先抢沙发后发作业

点击这里给我发消息

发表于 2014-3-9 07:27:16 | 显示全部楼层
留名占地。
回复

使用道具 举报

点击这里给我发消息

发表于 2014-3-9 23:00:31 | 显示全部楼层
支持老师,支持论坛,149B学员
发表于 2014-3-11 13:17:57 | 显示全部楼层
作业写得都差不多,我的不一样,传送门http://www.office-cn.net/forum.p ... mp;page=1#pid698013
发表于 2014-3-23 20:29:54 | 显示全部楼层
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;
namespace listtest
{
    public partial class listtest1
    {
        public static string DefalutRoom = "2175343697";
        public static KeyValuePair<double, string> ChannelVSTO = new KeyValuePair<double, string>(91283328, "Office中国");
        public static Dictionary<string, string> YYRoomList = new Dictionary<string, string>();

        private void listtest1_Load(object sender, RibbonUIEventArgs e)
        {

            YYRoomList.Add("1768232513", "接待大厅");
            YYRoomList.Add("2175343697", "VSTO培训-初级班(一期)");
            YYRoomList.Add("1768402953", "Office教学");
            gallery1.Items.Clear();
            itemAdd(gallery1);

        }

        private void gallery1_Click(object sender, RibbonControlEventArgs e)
        {

            EnterYYRoom(ChannelVSTO.Key.ToString(), gallery1.SelectedItem.Tag.ToString());
        }
        private void itemAdd(RibbonGallery mygallery1)
        {
            foreach (var item1 in YYRoomList)
            {
                RibbonDropDownItem kiwyButton1 = this.Factory.CreateRibbonDropDownItem();

                kiwyButton1.Tag = item1.Key.ToString();
                kiwyButton1.Label = item1.Value;
                mygallery1.Items.Add(kiwyButton1);
            }
        }


        void EnterYYRoom(string cChanel, string cRoom)
        {
            try
            {
                //打开YY软件
                System.Diagnostics.Process.Start("yy://pd-[sid=" + cChanel + "&subid=" + cRoom + "]");

            }
            catch (System.Exception ex)
            {
                //打开网页版YY
                System.Diagnostics.Process.Start("http://yy.com/" + cChanel + "/" + cRoom + "?from=");
            }

        }

    }
}


不知道为什么sender转换的时候总出错,这么写结果倒是运行出来了,加完班赶快把落下的作业写上,第3节课的不知道什么时候能听完再做呢。
119-B
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-19 06:32 , Processed in 0.087110 second(s), 31 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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