stickleprojects Level: Moderator

 Registered: 09-09-2002 Posts: 1040
|
Re: MDI application
Hi.
In .NET, they finally stopped loading forms for you automatically (yay), so each frm is now a class.
there is no such thing as "frmRecipe", you would need to create an instance of the form ("forms as objects" in MSDN/google)
m_iWhichForm is a variable, right?
When do you change this? How is it kept uptodate? In VB6, on an MDI form, there is no built-in event for which form is active. Do you have a mechanism for detecting the active form? IF so, what does it work on? Most of the code will still work in .NET.
In the simplest case, change your code:
Private Sub NewToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripButton.Click
Select Case m_iWhichForm
Case 35 'recipe
ActiveForm.NewRecord()
Case Else
End Select
End Sub
|
I think that will work in vb.net.
I note that you haven't supplied the error message (if any).
I suggest you read up on forms as classes as this is a really really big point of .net.
____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)
|