Пример #1
0
        /// <summary>
        /// “美食分类”
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tbFoods_Selecting(object sender, TabControlCancelEventArgs e)
        {
            if (e.TabPage == null || e.TabPage.Tag == null)
            {
                return;
            }                                                                                                //Controls.Clea()会触发此事件 e.TabPage可能是null或者是有值
            Dictionary <Guid, string> dic = icookieInfoService.LoadEntitiesByCategoryId((int)e.TabPage.Tag); //所有指定分类下的“美食”键值集合
            ListView lv = (ListView)e.TabPage.Controls[0];

            lv.Clear();
            foreach (var key_value in dic)
            {
                lv.Items.Add(key_value.Value, lv.Items.Count % 2).Tag = key_value.Key;
            }
            //为每个“美食图标”注册单击事件
            lv.DoubleClick += new EventHandler((a, b) =>
            {
                if (lv.SelectedItems.Count > 0)    //说明点击在item上,
                {
                    F_CookieInfo f_cookie   = new F_CookieInfo();
                    f_cookie.current_cookie = icookieInfoService.LoadEntitByCookieId((Guid)lv.SelectedItems[0].Tag);
                    f_cookie.Show();
                }
            });
        }
Пример #2
0
 private void lbSearchResult_DoubleClick(object sender, EventArgs e)
 {
     if (lbSearchResult.SelectedIndices.Count > 0)   //判断是否在列表上双击的,而不是在控件的其他地方双击的
     {
         F_CookieInfo fc = new F_CookieInfo();
         fc.current_cookie = (lbSearchResult.SelectedItem as CCWin.SkinControl.SkinListBoxItem).Tag as cookinfo;
         fc.Show();
     }
 }
Пример #3
0
 private void skinListBox1_DoubleClick(object sender, EventArgs e)
 {
     if (skinListBox1.SelectedIndices.Count > 0)
     {
         F_CookieInfo fc = new F_CookieInfo();
         fc.current_cookie = (cookinfo)((SkinListBoxItem)skinListBox1.SelectedItem).Tag;
         fc.Show();
     }
 }