in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

C1NavBar

Last post 03-05-2008 9:28 AM by C1_JohnAd. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-03-2008 10:56 PM

    C1NavBar

    I just downloaded C1Suite and it is great! I was wondering though

    If I have a C1NavBar running the vertical left side of a main form (winForms) how can I in C# position all my child forms just to the right of the C1NavBar when they open.

    Or can I place a SplitContainerPanel on the main form and then add the C1navbar and C1Command to Panel 1 and then  open the child forms in panel2?

     

    Thanks Jon Stroh

  • 03-04-2008 10:30 AM In reply to

    Re: C1NavBar

    Hi Jon,

    In regards to your query I would suggest you to try the following code
    snippet:

    ---------------------------------------------------------------------------------------------------------------------------------
    BEGIN CODE

    private void c1NavBar1_ButtonClick(object sender, EventArgs e)
    {

    //P.S the first panel of SplitContainer contains C1NavBar on the left of the
    MDIParent

    // Create a new instance of the child form.

    Form childForm = new Form();

    // Make it a child of this MDI form before showing it.

    childForm.MdiParent = this;

    childForm.Text = "Window " + ++childFormNumber; // childFormNumber is
    Public (Form Level) Variable .

    childForm.Top = this.splitContainer1.Panel2.Top; // SplitContainer's Panel2

    childForm.Left = this.splitContainer1.Panel2.Left;

    childForm.Show();

    this.splitContainer1.Panel2.Controls.Add(childForm);
    }

    END CODE
    ---------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Regards,
    John Adams

    wrote in message news:202508@10.0.1.98...
    I just downloaded C1Suite and it is great! I was wondering though
    If I have a C1NavBar running the vertical left side of a main form
    (winForms) how can I in C# position all my child forms just to the right of
    the C1NavBar when they open.
    Or can I place a SplitContainerPanel on the main form and then add the
    C1navbar and C1Command to Panel 1 and then open the child forms in panel2?

    Thanks Jon Stroh



    http://helpcentral.componentone.com/cs/forums/p/74519/202508.aspx#202508
  • 03-05-2008 8:38 AM In reply to

    Re: C1NavBar

    Thank you very much for taking the time to write that snippet for me. I think that will do the trick, do you think I will have to close childForm1 before opening childForm2 or just remove it from the panel first before adding the second child form to the panel?

     

    Thank You very much

    Jon Stroh

    Filed under:
  • 03-05-2008 9:28 AM In reply to

    Re: C1NavBar

    Hi Jon,

     

    Thank you for updating me. It is good to hear that the code snippet was helpful. However, regarding your new query I would like to mention that if you are not using ChildForm1 while ChildForm2 is opened then you can close the ChildForm1 before opening the ChildForm2 or if you need to use the ChildForm1 while ChildForm2 is opened then you can hide the ChildForm1 before opening the ChildForm2.

     

    Please try this and let me know your observations.

     

    Regards,

    John Adams

     
     
    <jonstroh> wrote in message news:202561@10.0.1.98...

    Thank you very much for taking the time to write that snippet for me. I think that will do the trick, do you think I will have to close childForm1 before opening childForm2 or just remove it from the panel first before adding the second child form to the panel?

     

    Thank You very much

    Jon Stroh



    http://helpcentral.componentone.com/cs/forums/p/74519/202561.aspx#202561

Page 1 of 1 (4 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.