• c# 創建右鍵功能



                //定義右鍵
                ToolStripMenuItem DeletePhraseMe = new ToolStripMenuItem();
                DeletePhraseMe.Name 
    = "DeleteBookMark";
                DeletePhraseMe.Text 
    = "刪除詞庫";
                
    //定義右鍵事件
                DeletePhraseMe.Click += new EventHandler(DeletePhraseMe_Click);
                
    //增加控件(dgvMe)右鍵
                dgvMe.gmnRightMenu.Items.Add(DeletePhraseMe);

            /// <summary>
            
    /// 公用詞庫右鍵刪除功能
            
    /// </summary>
            
    /// <param name="sender"></param>
            
    /// <param name="e"></param>
            void DeletePhraseComm_Click(object sender, EventArgs e)
            {
                
    //得到主鍵GUID值
                
    //msPraGUID = dgvCommon.CurrentRow.Cells[0].Value.ToString();
                string sPrimaryKey = mdtSource.PrimaryKey[0].ToString();
                
    //得到主鍵GUID值
                msPraGUID = dgvCommon.CurrentRow.Cells[sPrimaryKey].Value.ToString();

                
    if (this.tabPra.SelectedTab.Name.ToString() == "tabComm" && dgvCommon.CurrentRow != null)
                {
                    
    bool delSucceeded = FrontRemoting.Remoting.DeletePraRecord(ClbFrontInfo.clsFrontInfo.UserKey, this.Tag.ToString(), "//@filterGUID", msPraGUID);
                    
    if (delSucceeded)
                    {
                        
    //從界面上刪除已刪除的資料
                        dgvCommon.Rows.Remove(dgvCommon.CurrentRow);
                        FrontHelper.ShowMsg(
    2"刪除成功!");
                    }
                }
            }

  • 相关阅读:
    单调栈
    LRU先进先出算法
    IntelliJ IDEA 的安装
    IntelliJ IDEA 的介绍
    Tampermonkey 油猴脚本例子2
    Tampermonkey 油猴脚本例子
    Python PIL.Image 图片操作
    Python os 备查
    Pytorch tensor 常用操作 备查
    Pytorch torchvision.utils.save_image 图片保存工具
  • 原文地址:https://www.cnblogs.com/scottckt/p/876632.html
Copyright © 2020-2023  润新知