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. [SOLVED] GUI Problem - Added Forms To Tab Control

[SOLVED] GUI Problem - Added Forms To Tab Control

Scheduled Pinned Locked Moved C#
helpdesignquestion
3 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.
  • A Offline
    A Offline
    AmbiguousName
    wrote on last edited by
    #1

    Hello guys. I have a Tab Control in which I have placed two Forms. The advantage of this approach is: I designed the Form separately and it has it's own class (unlike TabPage). TabPage is the parent and the Windows Form is the child control here. But I am having a small problem. When I run the application, the GUI of the the forms is little disturbed. I mean the controls were not there, where I placed them. NOTE: I also ran the application by modifying form's size w.r.t tab's size but it did not help much: like this

    Form1.Height = Tab1.Height;
    Form1.Width = Tab1.Width;

    If don't change form's original size and show it in messagebox, then this does not show original size which I set at the design time. What could I do to tackle this issue? Thanks for any pointers.

    This world is going to explode due to international politics, SOON.

    O 1 Reply Last reply
    0
    • A AmbiguousName

      Hello guys. I have a Tab Control in which I have placed two Forms. The advantage of this approach is: I designed the Form separately and it has it's own class (unlike TabPage). TabPage is the parent and the Windows Form is the child control here. But I am having a small problem. When I run the application, the GUI of the the forms is little disturbed. I mean the controls were not there, where I placed them. NOTE: I also ran the application by modifying form's size w.r.t tab's size but it did not help much: like this

      Form1.Height = Tab1.Height;
      Form1.Width = Tab1.Width;

      If don't change form's original size and show it in messagebox, then this does not show original size which I set at the design time. What could I do to tackle this issue? Thanks for any pointers.

      This world is going to explode due to international politics, SOON.

      O Offline
      O Offline
      Obaid ur Rehman
      wrote on last edited by
      #2

      First of all, you can also use a UserControl instead of placing forms in tab pages. Also have a look at the Anchor property[^]

      A 1 Reply Last reply
      0
      • O Obaid ur Rehman

        First of all, you can also use a UserControl instead of placing forms in tab pages. Also have a look at the Anchor property[^]

        A Offline
        A Offline
        AmbiguousName
        wrote on last edited by
        #3

        Obaid ur Rehman wrote:

        you can also use a UserControl instead of placing forms

        Magar yeh meri application requirement nhi hai. Agar main aisa karta to mujhay UserControl ka code bhi apnay customer ko dena parhay ga, jo keh main nhi chahta. Waisay bhi, kitna ajeeb lagay gaa jab hum pooray ka poora inventory form design kar kay, ussay UserControl bnaa dain. I have seen people preferring my approach over the one you suggested. I think it depends mostly on application requirement.

        This world is going to explode due to international politics, SOON.

        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