Form inside a panel - Windows CE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • steveb
    New Member
    • Oct 2012
    • 2

    Form inside a panel - Windows CE

    Hello,
    I'm new to VB.NET, so my question may be basic for you.
    I'm using MS Visual Studio 2008 (VB) to write an application that runs in Windows CE 5.0.
    I have created a project for smart devices with one form (Form1) and I have added a second form (Form2).
    In Form1 I have added a panel and a button and I want to display Form2 inside the panel when the user click the button.
    This is the base, than I will add other buttons and other forms.
    I have searched the web for an answer and in this community I found a post ("Form inside a panel" by Fabio Nov 20 '05) but it doesn't work for me because Form2 has not the property "TopLevel".
    I usually write applications for desktop pc using Embarcadero C++ Builder and in that IDE is very easy to do such a thing, it's enough to set the panel as the parent of Form2 and you're done but here it doesn't seem to be so easy, at least for me.

    Anybody can help me?

    Thanks in advance

    Stefano
  • steveb
    New Member
    • Oct 2012
    • 2

    #2
    Hello again,
    I have found a solution that for me seems to works.
    Instead of adding a form (Form2) I add a UserControl1 and in the code of the button click I set the parent of the UserControl as the panel and I set its property Visible to True.
    In this way I can add as many UserControls as I need and hide or show them as necessary.
    I apologize if my question seemed rushed and the solution trivial.
    Unfortunately I'm not familiar with Visual Studio and it was a coincidence to find a solution a few minutes after I wrote my question ...
    Thanks anyway for your attention

    Stefano

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Thank you for posting your solution :)

      -Frinny

      Comment

      Working...