Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. parent, showing a form

parent, showing a form

Scheduled Pinned Locked Moved C#
questioncsharp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    THEMYTH
    wrote on last edited by
    #1

    Hello, I have been developing a program. There are lots of forms, and I do need to show some of them(when they become necessary) I was using a method to show a form inside a picturebox. I have used the SetParent and GetParent apis to perform the operation that I wish in Visual Basic 6. I was able to show a form inside a picture box or frame. Show I can Load and Unload forms that I want. How can I do that in C#? Thank you for your time. Best Regards Emre YAZICI

    R 1 Reply Last reply
    0
    • T THEMYTH

      Hello, I have been developing a program. There are lots of forms, and I do need to show some of them(when they become necessary) I was using a method to show a form inside a picturebox. I have used the SetParent and GetParent apis to perform the operation that I wish in Visual Basic 6. I was able to show a form inside a picture box or frame. Show I can Load and Unload forms that I want. How can I do that in C#? Thank you for your time. Best Regards Emre YAZICI

      R Offline
      R Offline
      Rocky Moore
      wrote on last edited by
      #2

      One easy way that allows tabbing to work properly and looks natural is to use UserControls for your forms and create them as needed. You would place a panel control on your form where you want the embedded form to show and in your code, you would create the user control you want displayed and add the control to the Panel's Controls collection. When you want to change to another UserControl, you can clear the Panel's Controls collection and add the new one. Another way is by using a tab control and convering the tabs. And yet another way is to set the form's border you wish to embed to nothing and the control box to nothing (last step many not be needed) and set the Form's TopLevel to false; You can then add it to the Panel's Control list and use a Show() on the form. This will however cause you tabbing problems. I never went further than this since the UserControl method above gave me all that I could desire. Rocky Moore <><

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups