Re: circular calling windows

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • Re: Need help with netstat and connections running in background
    ... Right click on the cmd Title bar, point to Edit and click on Select All. ... Alt + Spacebar opens context menu ... You can type in a command prompt: ... How to start Windows in Safe Mode Windows XP ...
    (microsoft.public.windowsxp.general)
  • Re: IE 6 Will not open inside specific User Profile
    ... Click Advanced or Edit, ... You Cannot Open New Internet Explorer Window or Nothing Happens After You ... >I have a client that is running Windows XP Home SP1 on a Dell system. ... > unable to register it because whenever I tried to register it, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Ohhh....Ramesh, Kelly....Thank you
    ... fixing the rest of the bags edit by either running my edit on line 2 (which ... 2004 Windows MVP "Winny" Award ... > "Ratan Maitra" wrote in message ... > I had read somewhere that "Play all" is actually a link to the default ...
    (microsoft.public.windowsxp.general)
  • Re: No other power washer cleans more thoroughly.
    ... I never listen to commercials. ... Windows 7, and I don't like Agent 5.0. ... to try to edit it, and although I could see it, I couldn't edit it. ... file into my own Windows folder. ...
    (soc.retirement)