[C++ CLI] MenuStrip Form help

Hello, i want to change my program, now my program work like a charm, but for one action i have one form and i want to make MenuStrip and use menu for selecting action, one menu, one form, but when i click menu and call form, then i see another form and i want to see this form inside this MenuStrip Form. It's possible?

What i have now: http://prntscr.com/b7f7f7
What i want: http://prntscr.com/b7f8e4

It's possible?

Thanks.
Last edited on
I make this code

1
2
3
4
5
6
7
#include "LoginScreen.h"
. . .
private: System::Void menu_Login_Click(System::Object^  sender, System::EventArgs^  e) {
		LoginScreen^ loginscreen = gcnew LoginScreen();
		loginscreen->MdiParent = this;
		loginscreen->Show();
	}


but i have this error Additional information: Form cannot be both an MDI child and MDI parent.

I change isMdiContainer to true for LoginScreen form.
aaah nevermind :D i change ismdicontainer to loginscreen form, not for menustrip form :D

but one question, how can i make login, and after login to display next form inside this one? when i include form1.h in form2.h and in form2.h include form1.h i get error.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
private: System::Void backgroundWorker1_ProgressChanged(System::Object^  sender, System::ComponentModel::ProgressChangedEventArgs^  e) {
		Datapacket^ dp = dynamic_cast<Datapacket^>(e->UserState);
		HlavneMenu^ hlavnemenu = gcnew HlavneMenu();
		MenuStrip^ menu = gcnew MenuStrip(); //i dont know what i need to do with this
		if (dp->val_loginresult == "success")
		{
			hlavnemenu->UserId = dp->val_reader->GetString(0);
			hlavnemenu->Meno = textBox1_username->Text;
			hlavnemenu->mConnection = dp->val_connection;
			hlavnemenu->Show();
			button_prihlasSa->Text = dp->val_reader->GetString(0);
			pictureBox1->Visible = false;
		}
	}


I need to show after successfully login form with name hlavnemenu in container, what i need to do please? Thanks a lot :)
Last edited on
Nevermind, i got another solution and now i need only one help, how can i check if form1 is opened, and if isn't opened, then open new form->Show() and if is opened, then do nothing. This not work

1
2
3
4
5
6
7
8
9
private: System::Void menu_Login_Click(System::Object^  sender, System::EventArgs^  e) {
		LoginScreen^ loginscreen = gcnew LoginScreen();
		PridanieTasku^ addTask = gcnew PridanieTasku();
		loginscreen->MdiParent = this;
		if (loginscreen->Visible==false)
		{
			loginscreen->Show();
		}
	}
=
Last edited on
Topic archived. No new replies allowed.