Bizar problem with a form (different instances act like one!)

G

Guest

Hi all,

I have got a really weird problem:
- A normal VB.net forms application
- One MDI child form with a bunch of controls (tabs, radiobuttons, combo's,
etc.)
- The form is called from several procedures as kind of a dialog
- To my knowledge we haven't done anything in the disigner / code which can
be described as unusual

When de form is called multiple time they seem te listen to each others
events! So when I change a combo, the combobox will change on all forms ?!
All instances are created through a new / contructor and to my knowledge no
variables / controls are declared as static.

Does anyone have ever seen this or made this kind of functionality on
purpose?

I better hope it isn't a little switch in de IDE we turned on by accident.

Hope you can help,

Best regards,

Joost van den Berg
 
R

Richard Carpenter

Hi all,

I have got a really weird problem:
- A normal VB.net forms application
- One MDI child form with a bunch of controls (tabs, radiobuttons, combo's,
etc.)
- The form is called from several procedures as kind of a dialog
- To my knowledge we haven't done anything in the disigner / code which can
be described as unusual

When de form is called multiple time they seem te listen to each others
events! So when I change a combo, the combobox will change on all forms ?!
All instances are created through a new / contructor and to my knowledge no
variables / controls are declared as static.

Does anyone have ever seen this or made this kind of functionality on
purpose?

I better hope it isn't a little switch in de IDE we turned on by accident.

Can you list the code here that you use to instantiate the form?

Rich
 
G

Guest

Location A:

Private Sub ToolStripButtonTemp_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ToolStripButtonTemp.Click

Dim t As New MRC.Forms.FormProbeEdit
t.MdiParent = Me
t.FormMain = Me
t.Show()

End Sub

Location B:

'Create a new form
CurrentEditForm = New MRC.Forms.FormProbeEdit

With CurrentEditForm

'Set owner
.MdiParent = Me.FormMain
.FormMain = Me.FormMain

'Show form
Call .Show()

'Set probe
.Probe = CurrentProbe

End With

As you can see, they both call the constructor.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top