0
点赞
收藏
分享

微信扫一扫

5.6软件工程-运维

是归人不是过客 2024-08-04 阅读 31

 private void checkBox1_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox1.Checked) 
     {
      textBox2.PasswordChar = '\0';
     }
     else { textBox2.PasswordChar = '*'; }
 }

 

   private void listBox1_MouseDown(object sender, MouseEventArgs e)
   {
      
       if (e.Button == MouseButtons.Right)
       {
           if (listBox1.SelectedItems.Count != 0)
           {
               删除ToolStripMenuItem.Enabled = true;
           }
           else
           {
               删除ToolStripMenuItem.Enabled = false;
           }
           this.contextMenuStrip1.Show(listBox1, e.Location);

       }

   }
  private void 删除ToolStripMenuItem_Click(object sender, EventArgs e)
  {
      listBox1.Items.Remove(listBox1.SelectedItem);
      string str = JsonConvert.SerializeObject(listBox1.Items, Formatting.Indented);
      File.WriteAllText("登陆日志.txt", str);
      listBox1.ClearSelected();
  }
举报

相关推荐

0 条评论