Windows窗体中的关闭按钮不会在一次点击中关闭窗体 [英] Close button in windows form doesn't close the form in one hit

查看:70
本文介绍了Windows窗体中的关闭按钮不会在一次点击中关闭窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Experts,



我有windows窗体,其中gridview单元格双击打开一个新窗体,单击的行值提供更新选项。在这里,我似乎一切正常。但是当我关闭显示单击行详细信息的新表单时,它会再次加载而不是关闭表单。

这是我打开新表单的代码。还有新形式的代码

Hello Experts,

I have windows Forms in which gridview cell double click open a new form with the clicked row values providing an option to update. Here I have everything seems working fine. But when I closed the new form which shows the clicked row details, it is loading again instead of closing the form.
Here is my code to open the new form. And also the code in New form

 Private Sub DataGridView1_CellMouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseDoubleClick, DataGridView1.CellMouseDoubleClick 
Dim dialog As New EditFeaturedItem(row)
     dialog.ShowDialog()
     dialog.Dispose()
End Sub



和新的EditFeatureItem表单有以下代码


And the New EditFeatureItem Form has below code

Friend Class EditFeaturedItem
  Private _seq As DataGridViewRow

  Private Sub New()
    ' This call is required by the Windows Form Designer.
    InitializeComponent()
    ' Add any initialization after the InitializeComponent() call.
  End Sub
  Public Sub New(ByVal seq As DataGridViewRow)
    Me.New()
    _seq = seq
    ShowDetails(seq)
  End Sub







任何人都可以帮我解决这个问题。如果用户单击表单上的交叉按钮,我想关闭表单。




Can anyone help me out in resolving the issue.? I wanted to close the form if user clicks on Cross button on the form.

推荐答案

您是否关闭了应用程序框架?
Did you turn off the application framework?


这篇关于Windows窗体中的关闭按钮不会在一次点击中关闭窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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