How to close one form while opeing other form in vb.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chandrajit
    New Member
    • Aug 2007
    • 13

    How to close one form while opeing other form in vb.net

    Hi,
    I am new to vb.net. Please help me in ..
    I have two form in my application. when i put some data from second from to first form i want to close second form.
    I am using me.close, but it's not working, the form still remains open.
    Please help me
    Thanks in advance.
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    have you tried debugging it? by putting a breakpoint at the line where you close the form, and checking if that line is processed when you want it ?

    Comment

    • Chandrajit
      New Member
      • Aug 2007
      • 13

      #3
      Originally posted by Shashi Sadasivan
      have you tried debugging it? by putting a breakpoint at the line where you close the form, and checking if that line is processed when you want it ?

      Yes i have debugged and that line is executing properly, but not closing the form. I am attaching my code for you reference.

      Dim RoleMaster As New frmRoleMaster
      GetRole = "LoadMode"
      RoleMaster.txtR oleName.Text = grdRoleView.Ite m(grdRoleView.C urrentRowIndex, 0)
      If IsDBNull(grdRol eView.Item(grdR oleView.Current RowIndex, 1)) = True Then
      RoleMaster.txtR oleDescription. Text = ""
      Else
      RoleMaster.txtR oleDescription. Text = grdRoleView.Ite m(grdRoleView.C urrentRowIndex, 1)
      End If
      If IsDBNull(grdRol eView.Item(grdR oleView.Current RowIndex, 2)) = True Then
      RoleMaster.cmbD ataFilter.Text = ""
      Else
      RoleMaster.cmbD ataFilter.Text = grdRoleView.Ite m(grdRoleView.C urrentRowIndex, 2)
      End If
      RoleMaster.txtR oleId.Text = grdRoleView.Ite m(grdRoleView.C urrentRowIndex, 5)
      Me.Close()
      GetRole = "ViewMode"
      RoleMaster.Show Dialog()

      Comment

      • YGayatri
        New Member
        • Nov 2007
        • 9

        #4
        Hi,

        Are you saying that you are able to see the form in taskbar still?

        Comment

        • Chandrajit
          New Member
          • Aug 2007
          • 13

          #5
          Originally posted by YGayatri
          Hi,

          Are you saying that you are able to see the form in taskbar still?

          Yes exactly, still i am able to see th form in taskbar

          Comment

          • painkiller
            New Member
            • Nov 2007
            • 17

            #6
            try this vb.net code
            ===============
            me.dispose(true )

            Comment

            • YGayatri
              New Member
              • Nov 2007
              • 9

              #7
              Originally posted by Chandrajit
              Yes exactly, still i am able to see th form in taskbar
              In that case, set the property of "Show in Taskbar" of the form to false.
              That would solve the problem.

              Comment

              Working...