2 Replies - 685 Views - Last Post: 19 February 2013 - 06:55 AM Rate Topic: -----

#1 varunit  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 39
  • Joined: 03-September 09

Switching between two forms

Posted 19 February 2013 - 01:30 AM

I will have form1 which will always remain open. Then I have my form2 which gets displayed when user clicks a button in form1 and populates some picture in form2. Later when the user finishes viewing form2 and selects form1 again from taskbar, form2 must be closed automatically. This routine has to be repeated for a particualr button click event from form1.

Which event do I have to add the code to show and hide my form2?

Form1.Activated or Form1.Click or Form1.Enter or and so on.. Which would be the best event?

Is This A Good Question/Topic? 0
  • +

Replies To: Switching between two forms

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3479
  • View blog
  • Posts: 10,725
  • Joined: 05-May 12

Re: Switching between two forms

Posted 19 February 2013 - 06:10 AM

If I recall correctly, you'll need the Activated event for the case when the user clicks on the task bar, or clicks on the form to bring focus back to it. Assuming that works, then I don't see a need for a button on Form1 to hide Form2 since whenever Form1 is active and has focus, you should have already hidden Form2 by that time.
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5439
  • View blog
  • Posts: 11,669
  • Joined: 02-June 10

Re: Switching between two forms

Posted 19 February 2013 - 06:55 AM

[*]Q: ...get Form/class 'A' to make a change or talk to Form/class 'B'
Spoiler

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1