Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2006

Tip: Looking for answers? Try searching our database.

circular calling windows

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hennie7863 - 16 Jun 2006 12:28 GMT
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
GhostInAK - 16 Jun 2006 19:22 GMT
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,
>
[quoted text clipped - 13 lines]
>
> Hennie
Hennie7863 - 04 Jul 2006 15:18 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.