PDA

View Full Version : Coding an app help[C#|Visual Studio 2008]


Luckyfox777
7th June 2009, 04:51 PM
Hi there, need some help coding an app, it's similar to somekind of "who wants to be a millionaire?"
The base is that there is a question and 4 variants each page(window), answering one question leads you to the next one, the problem is that i don't know how to connect the windows.

i have kind of
Q1.cs
Q2.cs
....
Q10.cs
------
form1.cs - which is the main window
the code is

private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Right! go to the next", "Information");
?????????????? // for example Q3 is next which is in other window with other image and style, and which is already created as Q3.cs in same project
}
i don't know what to put inside to call for example next question(window) same with menu items like About and Settings...
Please help. maybe somekind of link with tutorials.
msdn i know, didn't found this moment there.
Thanks.

Rudegar
7th June 2009, 05:54 PM
private void button1_Click(object sender, EventArgs e)
{
if(MessageBox.Show("Right! go to the next", "Information")==dialogresult.Ok)
{
//<other formname> maybe q1
q1 = new q1();
if(q1.showdialog()==dialogresult.ok)
{
//whatever
}

}
?????????????? // for example Q3 is next which is in other window with other image and style, and which is already created as Q3.cs in same project
}

your problem is not really a spc mobile problem
so any c# net examples you can dig up can help you

Luckyfox777
7th June 2009, 11:05 PM
Rudegar thank you, but it isn't quite what i am searching for,
here is the image which probably will explain better what i ask/search.
hope somebody can help with code. :(
http://xmages.net/out.php/i263721_HOWto.jpg

there is Form1.cs and Form2.cs, how to pass from one to another using button_click event?

Rudegar
8th June 2009, 07:49 PM
private void options_click(blablabla bla)
{
form2 myform = new form2();
myform.showdialog();
}

private void back_click(,,,,,)
{
Close();
}

MrRalphMan
8th June 2009, 08:53 PM
Without knocking your method, why have you not got one page that has the buttens etc set up and change them when the questions change, rather then have 10 forms that are exactly the same?

Luckyfox777
9th June 2009, 11:18 AM
Rudegar THANK YOU! that was it! it works perfect! RESPECT for your help!
MrRalphMan well because there will be different forms - ones with textbox to fill in, others with guess the image, others with sound to recognise and so on...
the purpose of the programe should be E-Learning - foreign language learning app, it will help user study new words of the new language.

Rudegar Thank you! :)