6 Replies - 856 Views - Last Post: 25 October 2013 - 05:50 AM Rate Topic: -----

#1 M.Paaske   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-January 10

How do I open diffrent "containers/panels" in the same "wi

Posted 23 October 2013 - 01:03 AM

Hello

So heres the "challenge", I got this form with 2 buttons in a windows from.
When I hit one of these buttons I want them to hide, and get another window/from where I have some diffrendt options, and when I'm done with them I want a button that returnes me to my original access point..

Any suggestions on how to acomplish this?
Is This A Good Question/Topic? 0
  • +

Replies To: How do I open diffrent "containers/panels" in the same "wi

#2 Michael26   User is offline

  • Futurama: Insert funny joke here
  • member icon

Reputation: 414
  • View blog
  • Posts: 1,664
  • Joined: 08-April 09

Re: How do I open diffrent "containers/panels" in the same "wi

Posted 23 October 2013 - 02:06 AM

Multiple-Document Interface (MDI)
Is this what you are looking for?
Posted Image
Was This Post Helpful? 0
  • +
  • -

#3 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5105
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: How do I open diffrent "containers/panels" in the same "wi

Posted 23 October 2013 - 06:50 AM

MDI isn't necessary, if you don't want that style. Forms have a Hide and Show method. You can hide your main form after you show your child form. Make sure to subscribe to the Close event of the child form (in the main form) so you can re-show your main form when the child one closes.

Edit: missed the title question, because it got cut off.

If you are asking about showing multiple windows inside a container window, MDI is exactly what you want.

If you just want to hide one panel and replace it with another, that's easy too. Layer one panel on top of the other, and alternate which is visible.
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 6818
  • View blog
  • Posts: 23,195
  • Joined: 05-May 12

Re: How do I open diffrent "containers/panels" in the same "wi

Posted 23 October 2013 - 09:54 AM

The layering approach doesn't work too well for people who like to drag n' drop development. I've looked over people's shoulders when they attempt this, and it's not pretty to watch with all the twiddling they have to do.
Was This Post Helpful? 0
  • +
  • -

#5 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5105
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: How do I open diffrent "containers/panels" in the same "wi

Posted 23 October 2013 - 10:40 AM

Layering isn't even necessary, if OP understands how Controls actually work. You can remove a child control from a parent and just store it in memory; you can swap controls inside a panel this way. There's so many means to this end, it's hard to give a definitive answer without more input from the OP.
Was This Post Helpful? 0
  • +
  • -

#6 M.Paaske   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-January 10

Re: How do I open diffrent "containers/panels" in the same "wi

Posted 24 October 2013 - 10:57 PM

Thanks alot guys, you've given me alot to think about, I'm trying to ease into it, I've done alot with ASP.NET, but for the moment I'm (sadly I must confess) drag 'n dropping in buttons and panels, unlike what I use todo..
Was This Post Helpful? 0
  • +
  • -

#7 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 6818
  • View blog
  • Posts: 23,195
  • Joined: 05-May 12

Re: How do I open diffrent "containers/panels" in the same "wi

Posted 25 October 2013 - 05:50 AM

If in ASP.NET you were using the CreateChildControls() approach of doing dynamic UI, you already half of what you need when playing with WinForms. Instead of having the page life cycle where you need to keep building the form layout by adding child controls, in WinForms you'll just need to set some controls as visible and others as invisible.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1