I'm sorry ididn't reply earlier. I had to finish some other problems. I
have three windows F1, F2 and F3.
F1 = Treeview+listview screen
F2 = Selectionscreen(with 3 options)
F3 = Edit screen with a New button. New calls F2 again
F1 can call F2 (new)
F1 can call F3 (edit an entry)
F2 can call F3 (a new entry)
F3 can call F2 (new is pressed)
i'm struggling with the show and showdialog property. At this moment i
use the following code :
F1 :
edit button:
Dim F3 As frmF3 = New frmF3(item)
frmF3.ShowDialog()
new button:
Dim F2 As frmF2 = New frmF2(item)
frmF2.ShowDialog()
F2 :
ok button
Dim F3 = New frmF3(Me)
F3.Showdialog()
F3 :
Private CallingForm As Object 'in the main declaration area
Public Sub New(ByVal Caller As Object) ' in the New constructor
CallingForm = Caller ' in the New
constructor
New button
Me.Close()
If Not IsNothing(CallingForm) Then
CallingForm.Top =
(Screen.PrimaryScreen.WorkingArea.Height - CallingForm.Height) / 2
CallingForm.Left =
(Screen.PrimaryScreen.WorkingArea.Width - CallingForm.Width) / 2
CallingForm.show()
CallingForm = Nothing
Else
'edit action has taken place and therefore the window
F2 doesn't exist.
Dim frm As frmF2 = New frmF2(item)
frm.Show()
End If
OK button:
Me.Close()
If Not IsNothing(CallingForm) Then
CallingForm.close()
CallingForm = Nothing
End If
THE PROBLEM :
This is the situation at this moment (after a day hacking). The problem
is as follows: when someone pushes the edit button in the F1 form the
form F3 is called. When the NEW button is pressed in F3 F2 is called.
But due to the showdialogs and shows, execution continues in F1 and
popups in the foreground and F3 is pushed to the back. But when i use
the showdialogs errors occurs because of a circular reference F2 calls
F3, F3 calls F2, etc. Execution of code is continued after the
showdialog and therefore its not possible
So how to make sure that the F3 popups in the foreground?
Greetz,
Hennie
GhostInAK schreef:
> Hello Hennie7863,
>
[quoted text clipped - 21 lines]
> >
> > Hennie
Bruce Wood - 04 Jul 2006 21:11 GMT
> I'm sorry ididn't reply earlier. I had to finish some other problems. I
> have three windows F1, F2 and F3.
[quoted text clipped - 7 lines]
> F2 can call F3 (a new entry)
> F3 can call F2 (new is pressed)
The first important question to answer here is (for each of the above
cases), does "can call" mean "brings the given screen to the
foreground, or, if the screen isn't showing, creates a new one," or
does it mean, "creates as new copy of the given screen and displays
it"?
This makes a big difference as to how you implement the forms. You need
to first define exactly what will happen when the user presses each
button, since "showing screen XX" is too vague and can mean either one
of the two things mentioned above.