Thread: load a second form from a button? vc++

  1. #1
    Registered User
    Join Date
    May 2006

    load a second form from a button? vc++

    Seems like an easy enough question... so easy in fact that 90% of what I have looked up about dialogs/forms/buttons glosses right over it. I'm hoping this isnt one of those questions that seem ridiculously simple but are way overly complicated. All I want to do is on a ButtonClick event from Form1, load Form2.

  2. #2
    Registered User
    Join Date
    May 2006
    Ok, I got it by doing this:

    private: System::Void bEdit_Click(System::Object^  sender, System::EventArgs^  e) {
    			 properties_form ^pf = gcnew properties_form;
    but can anyone tell me why in all the examples I find they use * instead of ^? I know in regular C++ what * signifies but th VC++ compiler always wants me to replace it with ^.

  3. #3
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    the '^' is C++/CLI syntax for a managed reference/pointer. It gives you a clear distinction between memory that you have to free and memory that the garbage collector will free. That's why you need gcnew as well. It makes things more clear for programming in the managed + unmanaged C++/CLI world.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-05-2010, 11:42 PM
  2. Just finished assembly assignment
    By xddxogm3 in forum Tech Board
    Replies: 6
    Last Post: 10-08-2005, 04:01 PM
  3. My UserControls dissapear off my form
    By zMan in forum C# Programming
    Replies: 2
    Last Post: 09-15-2004, 08:55 AM
  4. Replies: 0
    Last Post: 06-26-2004, 05:59 PM