zoukankan      html  css  js  c++  java
  • 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"刪除成功!");
                    }
                }
            }

  • 相关阅读:
    C++中几种字符串表示方法
    oracle11g卸载(win10)
    Dbvisualizer 连接oracle数据库
    严重: Exception starting filter struts2 Unable to load configuration.
    eclipse启动Tomcat服务输入http://localhost:8080/报404
    Tomcat内存溢出解决办法
    A Java Runtime Environment(JRE) or Java Development Kit (JDK) must be available in order to run Eclipse.
    Spring容器装配bean的方式
    Spring容器的基本实现
    spring环境搭建
  • 原文地址:https://www.cnblogs.com/scottckt/p/876632.html
Copyright © 2011-2022 走看看