Woof dog

Woof dog

  • NA
  • 3
  • 0

Opening new window within window

Jul 17 2009 5:05 AM
: Hi.  

I'm fairly new to C# programming and and working on some code and require some help.

I'm using Visual Studio 2008 and creating a Windows application.  The look of the program had like a MS Office ribbon at the top of the application.

Now for where I am getting stuck, I can modify the buttons on the ribbon (to call it such) and create the code to open a new window.  But the problem is the window opens in a new window not the existing window.
The ribbon has say button saying 'About' and 'Help', when I click on About I want the information below the ribbon to display the 'About' information, and when I click on 'help' it will display the information/text for 'help'

Anyone know how I can do the above?  As I said I'm fairly new to programming and even if someone can tell me what I need to research/learn to be able to do it that would be great as I can't find a thing.

~~~~~~~~~~~~~~~~~
EDIT:
I think I have it sorted out now.  Was able to talk to my old UNIX admin (who programs as well),

I want to do something like the below to be able to have Form1 open and when I click on a button for Form2 it should open in he same form window (if that makes sense).

     static int x = 200;
static int y = 200;

private void Button1_Click(System.Object sender,
System.EventArgs e)
{
// Create a new Form1 and set its Visible property to true.
Form1 form2 = new Form1();
form2.Visible = true;

// Set the new form's desktop location so it
// appears below and to the right of the current form.
form2.SetDesktopLocation(x, y);
x += 30;
y += 30;

// Keep the current form active by calling the Activate
// method.
this.Activate();
this.Button1.Enabled = false;
}




Answers (2)