Пример #1
0
 private void listViewKey_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     try
     {
         this.Slv = listViewKey.SelectedItems[0];
         for (int i = 0; i < Slv.SubItems.Count; i++)
         {
             int lvx  = Slv.SubItems[i].Bounds.Location.X;
             int lvxc = lvx + Slv.SubItems[i].Bounds.Width;
             if (e.X > lvx && lvxc > e.X)
             {
                 if (i == 5)
                 {
                     FrmKeyManage f = new FrmKeyManage();
                     f.BlockPermString = Slv.SubItems[i].Text;
                     if (f.ShowDialog() == DialogResult.OK)
                     {
                         Slv.SubItems[i].Text = f.BlockPermString;
                     }
                 }
                 else
                 {
                     tbEdit.Visible = true;
                     lvsid          = i;
                     tbEdit.Left    = listViewKey.Left + Slv.SubItems[i].Bounds.Left;
                     tbEdit.Top     = listViewKey.Top + Slv.SubItems[i].Bounds.Top;
                     tbEdit.Width   = Slv.SubItems[i].Bounds.Width;
                     tbEdit.Height  = Slv.SubItems[i].Bounds.Height;
                     tbEdit.Text    = Slv.SubItems[i].Text;
                     tbEdit.Focus();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Common.Log.WriteLog(ex.Message.ToString());
     }
 }
Пример #2
0
        private void button15_Click(object sender, EventArgs e)
        {
            FrmKeyManage key = new FrmKeyManage();

            key.ShowDialog();
        }
Пример #3
0
 private void button15_Click(object sender, EventArgs e)
 {
     FrmKeyManage key=new FrmKeyManage();
     key.ShowDialog();
 }
Пример #4
0
 private void listViewKey_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     try
     {
         this.Slv=listViewKey.SelectedItems[0];
         for (int i=0; i < Slv.SubItems.Count; i++)
         {
             int lvx=Slv.SubItems[i].Bounds.Location.X;
             int lvxc=lvx + Slv.SubItems[i].Bounds.Width;
             if (e.X > lvx && lvxc > e.X)
             {
                 if (i == 5)
                 {
                     FrmKeyManage f=new FrmKeyManage();
                     f.BlockPermString=Slv.SubItems[i].Text;
                     if (f.ShowDialog() == DialogResult.OK)
                     {
                         Slv.SubItems[i].Text=f.BlockPermString;
                     }
                 }
                 else
                 {
                     tbEdit.Visible=true;
                     lvsid=i;
                     tbEdit.Left=listViewKey.Left + Slv.SubItems[i].Bounds.Left;
                     tbEdit.Top=listViewKey.Top + Slv.SubItems[i].Bounds.Top;
                     tbEdit.Width=Slv.SubItems[i].Bounds.Width;
                     tbEdit.Height=Slv.SubItems[i].Bounds.Height;
                     tbEdit.Text=Slv.SubItems[i].Text ;
                     tbEdit.Focus();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Common.Log.WriteLog(ex.Message.ToString());
     }
 }