A little new to this.. Need help fixing this!

Yah so correct me if im wrong. I may not be able to explain this very well but I don't mean the .h itself I am talking about page changing when I run the .exe for my install script im trying to make.

Code:
1
2
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
			 }


I need it to redirect from Game1 to Game2 page. But when I run my .exe I can't get it to go to the next page of my install script.
I don't mean the .h itself

What .h are you talking about?
1
2
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
			 }

What language is this?
I need it to redirect from Game1 to Game2 page
What pages are you talking about, and what do you mean by redirect?

I may not be able to explain this very well

Understatement of the century.
Last edited on
The program I use is only for programming language C++. This is a C++ support forum correct?

Screenshot: http://i51.tinypic.com/23wqkya.png

Here is a screenshot if I couldn't of explained it very well in text. But it is C++ so that answers your question, "What language is this?"
That's not C++, if anything it's C++/CLI, which is Microsofts dotnettie version of C++. I doubt you'll find anyone here that works with C++/CLI. Even so, that still doesn't change the fact that you are expecting a solution to a problem you didn't provide any details to.
I did provide information about my problem did I not in my first post? I can make a video of what I mean and upload it to youtube if I didn't explain my problem very well or you can't understand what I mean?
Please tell me where exactly you state what your problem is. A video won't help if you can't even see the info you are not providing.

First: You still didn't confirm you are using C++/CLI. I guess you are, but it would help if you would spill it yourself instead of us having to grab straws.

Second (and third and fourth actually):
Yah so correct me if im wrong. I may not be able to explain this very well but I don't mean the .h itself I am talking about page changing when I run the .exe for my install script im trying to make.

You can't tell me you think that anyone can make sense out of this. Please explain precisely what you want to do.
Last edited on
Well I run the project I made (the screenshot) I have 2 pages for my install script. It goes to the first page but not the next page when I click, "I agree" on Game1. (button1 of the code in my first post.)

It won't go to the next page I have set. So what am I forgetting to put in it to make it change to the next page?



Was this explaining it a bit better?
I would be great if someone could help me out with this!
http://i51.tinypic.com/23wqkya.png

That is the picture you gave us. Please look at this picture. This is ALL the information we have about your project. Please think very closely about how anyone could help you with that level of information.
Ok I will explain it all over again.

This code for my first button:
1
2
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
			 }


I need it to redirect to the next page of my install script I am making. But it won't change pages. I could click "button1" when I run my project using the Game.exe. But nothing happens. So how can I get "Button1" to change pages?

If you still can not understand I will make a video of explaining it much easier to you asap so you can finally understand. Because I said this like 2 times already so to me it makes me feel english isn't your first language.
Last edited on
This is the member function of some class I don't know anything about, that is supposed to change a page (of which I know nothing). The body of that function is empty. If you don't provide the rest of your code, noone will ever be able to help you. Until you gain the ability to provide useful information, I will refrain from posting further in this thread.
Why would you need my entire code? Last time I check you had to put the code between..
1
2
3
 {

}


Of the button one code (provided above). Because I already edited my other button codes with Application::Exit();.
Well, please tell me how the hell I am supposed to know how to "change pages" in your program if I don't even know your definition of a page?
Here you go then: http://en.wikipedia.org/wiki/Pages

Screenshot: http://i54.tinypic.com/fz279i.png

Page #1 is the TOS page, and page 2 is the download page. I have everything setup but the button1 on page 1 which im talking about now. Is that helpful? You should of told me in the first place that you didn't know what Pages meant.
This isn't the right section for this thread? Swore the description of this section this forum was for.. C++/CLI. :/

Also modoran whats wrong with using C++? Maybe I just don't want to use vb?

@hanst99, I am not a troll. I am very serious about this thread. If you can't help me with my problem why do you keep replying to my thread? You just told me you didn't know what Pages meant so I showed you.
hanst99 wrote:
I don't even know your definition of a page?


^ So if anyone is trolling it is you my friend.

The funny thing is you people can't understand simple english and I explained what my problem is and all the information very well.
Last edited on
So will someone by kind enough to help me with my problem instead of wasting my time and actually read my post please? Also finally help me fix my problem with my project so this all can be laid down to rest?
hanst99 wrote:
Well, please tell me how the hell I am supposed to know how to "change pages" in your program if I don't even know your definition of a page?
Hidden307 wrote:
Here you go then: http://en.wikipedia.org/wiki/Pages

Screenshot: http://i54.tinypic.com/fz279i.png

Page #1 is the TOS page, and page 2 is the download page. I have everything setup but the button1 on page 1 which im talking about now. Is that helpful? You should of told me in the first place that you didn't know what Pages meant.

I fucking laugh hard at this. When hanst99 said "page definition"; he means the code behind that represents a "page". I hope that's clear enough.

Anyway, to your problem. You should do something like this.
1
2
3
4
5
6
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
				 Game2^ page2 = gcnew Game2();
				 this->Hide();
				 page2->Show();
			 }
	};


Of course Game2 should exist and should include Game2.h. A better solution is to use the .NET wizard control.
Thank you blackcoder41. But it seems to have a error.

1
2
3
4
5
6
7
8

1>c:\users\me\documents\visual studio 2010\projects\game\game\Game1.h(119): error C2065: 'Game2' : undeclared identifier
1>c:\users\me\documents\visual studio 2010\projects\game\game\Game1.h(119): error C2065: 'page2' : undeclared identifier
1>c:\users\me\documents\visual studio 2010\projects\game\game\Game1.h(119): error C2061: syntax error : identifier 'Game2'
1>c:\users\me\documents\visual studio 2010\projects\game\game\Game1.h(121): error C2065: 'page2' : undeclared identifier
1>c:\users\me\documents\visual studio 2010\projects\game\game\Game1.h(121): error C2227: left of '->Show' must point to class/struct/union/generic type
1>          type is ''unknown-type''
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Here is my entire code for Game1 incase I forgotten anything.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#pragma once

namespace Game {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for Game1
	/// </summary>
	public ref class Game1 : public System::Windows::Forms::Form
	{
	public:
		Game1(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Game1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Button^  button1;
	private: System::Windows::Forms::Button^  button2;
	private: System::Windows::Forms::TextBox^  textBox1;
	protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Game1::typeid));
			this->button1 = (gcnew System::Windows::Forms::Button());
			this->button2 = (gcnew System::Windows::Forms::Button());
			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
			this->SuspendLayout();
			// 
			// button1
			// 
			this->button1->Location = System::Drawing::Point(51, 222);
			this->button1->Name = L"button1";
			this->button1->Size = System::Drawing::Size(149, 44);
			this->button1->TabIndex = 0;
			this->button1->Text = L"I agree!";
			this->button1->UseVisualStyleBackColor = true;
			this->button1->Click += gcnew System::EventHandler(this, &Game1::button1_Click);
			// 
			// button2
			// 
			this->button2->Location = System::Drawing::Point(250, 222);
			this->button2->Name = L"button2";
			this->button2->Size = System::Drawing::Size(149, 44);
			this->button2->TabIndex = 1;
			this->button2->Text = L"I don\'t agree!";
			this->button2->UseVisualStyleBackColor = true;
			this->button2->Click += gcnew System::EventHandler(this, &Game1::button2_Click);
			// 
			// textBox1
			// 
			this->textBox1->AcceptsTab = true;
			this->textBox1->BackColor = System::Drawing::SystemColors::Window;
			this->textBox1->ForeColor = System::Drawing::SystemColors::WindowText;
			this->textBox1->ImeMode = System::Windows::Forms::ImeMode::NoControl;
			this->textBox1->Location = System::Drawing::Point(51, 23);
			this->textBox1->Multiline = true;
			this->textBox1->Name = L"textBox1";
			this->textBox1->ReadOnly = true;
			this->textBox1->ScrollBars = System::Windows::Forms::ScrollBars::Both;
			this->textBox1->Size = System::Drawing::Size(348, 174);
			this->textBox1->TabIndex = 2;
			this->textBox1->Text = resources->GetString(L"textBox1.Text");
			this->textBox1->TextChanged += gcnew System::EventHandler(this, &Game1::textBox1_TextChanged);
			// 
			// Game1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(448, 297);
			this->Controls->Add(this->textBox1);
			this->Controls->Add(this->button2);
			this->Controls->Add(this->button1);
			this->Name = L"Game1";
			this->Text = L"Game Title";
			this->Load += gcnew System::EventHandler(this, &Game1::Game1_Load);
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
			 }
	private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
				 Application::Exit();
			 }	
    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
				 Game2^ page2 = gcnew Game2();
				 this->Hide();
				 page2->Show();
			 }
	private: System::Void Game1_Load(System::Object^  sender, System::EventArgs^  e) {
			 }
};
}
Last edited on
You should include the header file Game2.h after pragma. Of course that is assuming Game2.h exist, base on the screen shot you've shown.

1
2
#pragma once
#include "Game2.h" 
Yah thank you. You saved me alot of time blackcoder i'd give you a hug but I can't reach. :P
Topic archived. No new replies allowed.