Re: circular calling windows
- From: "Hennie7863" <hdenooijer@xxxxxxxxxxx>
- Date: 4 Jul 2006 07:18:09 -0700
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,
By "tree" I assume you mean treeview. In this case don't use the Deactivate
event. Store the form reference somewhere (oCurrentForm) and when the user
clicks a different node in the tree you can do.. oCurrentForm.Hide
-Boo
Hi,
I have two forms A and B. Om form B i have a NEW button which should
call form A and after a selection on form A it will call form B again.
Hence a circular calling of forms.
On both forms i created a event:
Private Sub frmFormA_Deactivate(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Deactivate
Me.Hide()
End Sub
This will work when calling windows in a tree but not in a circular
reference. When i click outside the form (A or B) it will hide the
form. Can someone help me with this issue?
Hennie
.
- Follow-Ups:
- Re: circular calling windows
- From: Bruce Wood
- Re: circular calling windows
- Prev by Date: How to resize combobox?
- Next by Date: DataGridView, Net 2.0 - deselect
- Previous by thread: How to resize combobox?
- Next by thread: Re: circular calling windows
- Index(es):
Relevant Pages
|