【发布时间】:2018-12-04 13:57:23
【问题描述】:
我是 dot net 开发的新手。今天我下载了一个示例 c sharp 应用程序并在 Visual Studio 中打开它。这是视图设计器中打开的对话框:
我选择了Create 按钮,但我似乎无法在属性窗格中找到类似onClickListener 的任何字段。如何从视图设计器中设置它?
如果我在文本编辑器中打开相应的.designer.cs 文件。我可以看到监听器是这样分配的:
// create_file
//
this.create_file.Location = new System.Drawing.Point(53, 142);
this.create_file.Name = "create_file";
this.create_file.Size = new System.Drawing.Size(75, 23);
this.create_file.TabIndex = 1;
this.create_file.Text = "Create";
this.create_file.UseVisualStyleBackColor = true;
this.create_file.Click += new
System.EventHandler(this.button1_Click);
但是这个文件中的 cmets 说它不应该手动编辑。那么如何为按钮设置事件处理程序?
【问题讨论】:
-
您也可以单击属性窗口中的小闪电符号来查看事件