2 Replies - 7368 Views - Last Post: 06 June 2012 - 02:16 AM

#1 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

C++ windows form application multiple interfaces

Posted 22 May 2012 - 09:36 AM

idea tree to explain
class bank{private:int getbalance, int getclient}
|               |
admin         client
setbalance    read balance only


What I did is:
*create 3 forms 1.for login 2.for admin 3.for client.

Now in form1 that is for login I created a textbox and a button if I clock the button this code is inside the button I hope you understand my code to understand what I want. This doesn't work is there any other method other than this.

	
String choise = Textbox->text;
				 if(choise.Compare("teller") ){
				 Form2^ form2 = gcnew Form2();
				 form2->Show();
				}else if (choise.Compare("user"))
					Form3^ form3 = gcnew Form3();
				 form3->Show();
				
			 }

This post has been edited by busta5000: 23 May 2012 - 02:59 AM


Is This A Good Question/Topic? 0
  • +

Replies To: C++ windows form application multiple interfaces

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6092
  • View blog
  • Posts: 23,612
  • Joined: 23-August 08

Re: C++ windows form application multiple interfaces

Posted 22 May 2012 - 09:57 AM

Moved to C++ CLI
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3652
  • View blog
  • Posts: 11,421
  • Joined: 05-May 12

Re: C++ windows form application multiple interfaces

Posted 06 June 2012 - 02:16 AM

What do you mean by "This doesn't work"? It looks like in the worst case it'll show Form3.

Of course, you could be making the simple mistake of calling Form::Show() instead of Form::ShowDialog(). If you call Show(), you'll have a modeless dialog to keep running. If you close your Form1 after calling form2->Show() or form3->Show() then there will be no message pump to keep either of those forms alive.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1