DotNet Visual Basic: yet another question from me.

  • medicenpringles / 104 / Fri, 27 Mar 2009 21:31:00 GMT / Comments (7)
  • ok, so i have this application, and i need this long list of buttons that load a single form for each click.
    but for some reason, it gives me an "ObjectDisposedException was unhandled" error when i try to open it, close it, then open it again. here's my code:

    Public Class frmMain

    Public complete As New frmCompleteOrder

    Private Sub btnTC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTC6.Click, btnTC5.Click, _
    btnTC4.Click, btnTC3.Click, btnTC2.Click, btnTC1.Click
    complete.Show()
    End Sub

    End Class

    and also, the cancel button on frmCompleteOrder doesn't work the way it should. this is what the Cancel button has :

    Private Sub btnOrderCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOrderCancel.Click
    Me.Close()
    End Sub

    i'm sorry if i ask too many questions, i'm a real novice, but i plan on getting some books on it pretty soon.

    thanks,
    stephen
  • Keywords:

    me, dotnet, visual basic, vb, .net

  • http://dotnet.itags.org/dotnet-visual-basic/170/«« Last Thread - Next Thread »»
    1. Public Complete As New frmCompleteOrderTry changing that toPublic Complete As frmCompleteOrder

      x_ice | Tues, 04 Dec 2007 14:52:00 GMT |

    2. same thing.

      medicenpringles | Tues, 04 Dec 2007 14:53:00 GMT |

    3. Can you post the project so i can look for myself?

      x_ice | Tues, 04 Dec 2007 14:54:00 GMT |

    4. Public complete As frmCompleteOrder
      Private Sub btnTC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTC6.Click, btnTC5.Click, _
      btnTC4.Click, btnTC3.Click, btnTC2.Click, btnTC1.Click
      If complete Is Nothing Then complete = New frmCompleteOrder
      complete.Show()
      End Sub

      try this for me

      grilkip | Tues, 04 Dec 2007 14:55:00 GMT |

    5. same thing.

      Not always...

      kal_torak | Tues, 04 Dec 2007 14:56:00 GMT |

    6. Public complete As frmCompleteOrder
      Private Sub btnTC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTC6.Click, btnTC5.Click, _
      btnTC4.Click, btnTC3.Click, btnTC2.Click, btnTC1.Click
      If complete Is Nothing Then complete = New frmCompleteOrder
      complete.Show()
      End Sub

      try this for me

      doesn't change anything.

      i'm using beta 1. is that the problem?

      medicenpringles | Tues, 04 Dec 2007 14:57:00 GMT |

    7. doesn't change anything.

      i'm using beta 1. is that the problem?

      It's definitely the problem with your thread!!!!!!!!!!!!! This is the VB.NET forum and unless you say otherwise we all assume you are using VB.NET 2002 or 2003: And if you are using the beta 1 version of that, then you're on your own :bigyello:

      taxes | Tues, 04 Dec 2007 14:58:00 GMT |