Home » Category » DotNet Visual Basic

DotNet Visual Basic: yet another question from me.

104| Mon, 03 Dec 2007 15:38:00 GMT| medicenpringles| 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 & Tags: me, dotnet, visual basic, vb, .net

URL: http://dotnet.itags.org/dotnet-visual-basic/170/
 
«« Prev - Next »» 7 helpful answers below.
Public Complete As New frmCompleteOrderTry changing that toPublic Complete As frmCompleteOrder

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

same thing.

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

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

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

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 | Tue, 04 Dec 2007 14:55:00 GMT |

same thing.

Not always...

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

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 | Tue, 04 Dec 2007 14:57:00 GMT |

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 | Tue, 04 Dec 2007 14:58:00 GMT |

DotNet Visual Basic Hot Answers

DotNet Visual Basic New questions

DotNet Visual Basic Related Categories