C#如何在FLP中删除数据两次点击(双击winform) [英] C# how to delete data in FLP clicking on it two times(double click winform)

查看:96
本文介绍了C#如何在FLP中删除数据两次点击(双击winform)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要双击在FLP中删除我的数据。怎么做?



我尝试过:



i need delete my datas in FLP with double click. How to do it?

What I have tried:

public void Show()
        {
            flowLayoutPanel1.Controls.Clear();
            if (comboBox1.SelectedItem != null)
            {
                foreach (Group item in Controller.groups)
                {
                    GroupBox elm = new GroupBox();
                    elm.BackColor = Color.YellowGreen;
                    elm.Text = item.teacher;
                    elm.AutoSize = true;
                    elm.MinimumSize = new Size(150, 150);
                    Label lb = new Label();
                    lb.Location = new Point(0, 15);
                    lb.Text = "Group Name: " + item.group_name + "\n" + "Hours: " + item.hours;
                    elm.Controls.Add(lb);
                    lb.AutoSize = true;
                    flowLayoutPanel1.Controls.Add(elm);
                   
                }
            }
        }

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.Show();
        }

推荐答案

双击偶数通常不用于删除操作。在几乎我见过/写过的每个应用程序中,删除项目需要用户右键单击所需的项目,然后从后续的上下文菜单中选择删除。重新考虑你的设计。
The double-click even is not typically used for a delete action. In pretty much every app I've ever seen/written, deleting an item required the user to right click the desired item(s), and then select "Delete" from the subsequent context menu. Reconsider your design.


这篇关于C#如何在FLP中删除数据两次点击(双击winform)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆