Problem adding Tab control to a form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Muller

    #1

    Problem adding Tab control to a form

    Hi All,

    I'm running MSDE 2002, ver. 7.0.9466 with Net Framework 1.0, ver. 1.0.3705
    over Win2000ProSP4.

    I created a new Visual C# project using the Windows Application template.

    I'm trying to create a form (or dialog, I don't care which, for the moment)
    which has a vertical splitter with the left half containing a few tabbed
    pages and the right half a Rich Text Edit control.

    I added a Panel and docked it to the left and added the TabControl to the
    panel, along with a couple of tabs. I added a Splitter, which was generated
    to right of the panel. I added the Rich Text Edit control to the right of
    the splitter and gave it Fill docking.

    That worked pretty well except that the tab control did not occupy the full
    panel: it was docked to the lower right corner of the panel.

    How can I correct this? Are there some patches I should be adding to my
    configuration?

    --
    TIA,
    Richard

    640K ought to be enough for anybody.
    Bill Gates, 1981


  • Richard Muller

    #2
    One solution -- whaddaya think?

    Hi All,

    I got one solution that seems to work. I commented out one generated code
    line and substituted another as follows:
    // this.tabControl 1.Location = new System.Drawing. Point(80, 280); // RLM

    this.tabControl 1.Dock = System.Windows. Forms.DockStyle .Fill; // RLM

    These changes were made in InitializeCompo nent, which should be proper,
    right? That is, they shouldn't confuse the code generator nor get replaced
    by future use of the GUI creation mechanism, right?


    BTW, why wasn't the Dock property listed in the tabControl properties list?

    Regards,
    Richard

    "Richard Muller" <RichardLMuller DELETE@comcast. net> wrote in message
    news:eOzhnlfnDH A.2080@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hi All,
    >
    > I'm running MSDE 2002, ver. 7.0.9466 with Net Framework 1.0, ver. 1.0.3705
    > over Win2000ProSP4.
    >
    > I created a new Visual C# project using the Windows Application template.
    >
    > I'm trying to create a form (or dialog, I don't care which, for the[/color]
    moment)[color=blue]
    > which has a vertical splitter with the left half containing a few tabbed
    > pages and the right half a Rich Text Edit control.
    >
    > I added a Panel and docked it to the left and added the TabControl to the
    > panel, along with a couple of tabs. I added a Splitter, which was[/color]
    generated[color=blue]
    > to right of the panel. I added the Rich Text Edit control to the right of
    > the splitter and gave it Fill docking.
    >
    > That worked pretty well except that the tab control did not occupy the[/color]
    full[color=blue]
    > panel: it was docked to the lower right corner of the panel.
    >
    > How can I correct this? Are there some patches I should be adding to my
    > configuration?
    >
    > --
    > TIA,
    > Richard
    >
    > 640K ought to be enough for anybody.
    > Bill Gates, 1981
    >
    >[/color]


    Comment

    • Richard Muller

      #3
      Correct solution

      The Properties frame was too small, so I got fooled into thinking there was
      only one or two properties. I just realized that and discovered, happily,
      that there was a Dock property that I could have clicked, and which is set
      to "Fill" as a consequence of my manual code changes. Oh well, live and
      learn.


      Comment

      Working...