hi can someone teach me how to link my forms?

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2005
Posts: 38
Reputation: c#dummie is an unknown quantity at this point 
Solved Threads: 1
c#dummie c#dummie is offline Offline
Light Poster

hi can someone teach me how to link my forms?

 
0
  #1
Aug 1st, 2005
hi,

i've to set some conditions to my program. user has to enter a string of 9 letters + numbers eg. x1234567y OR 12 numbers eg. 111111111111 before hitting the ok button (this ok button in my 1st form will direct me to my 2nd form if i keyed in correctly). the system will do a pop-up box telling u if u had keyed in an invalid no, that is not 9 letters + numbers nor 12 numbers.

can someone teach me to link the forms by adding in the needed codes with some explanation if u can, to my codes given below, in a way as simple as possible?

here's part of my codes for the 1st form:


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;


namespace WindowsApplication2

{
///
/// Summary description for MedicalApplication.
///
public class Form1 : System.Windows.Forms.Form
{
.
.
.
.
.
.
private void button8_Click(object sender, System.EventArgs e)
{
<<button8 will link to form 2
}


here's form 2:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace WindowsApplication3
{
///
/// Summary description for ToCreatePatientFileInDatabase.
///
public class ToCreatePatientFileInDatabase : System.Windows.Forms.Form
{
.
.
.
.
.
.


Thanks! i really appreciate your help..
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: hi can someone teach me how to link my forms?

 
0
  #2
Aug 4th, 2005
try this im not sure what your asking but i think you want this

[code]

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;


namespace WindowsApplication2

{
///
/// Summary description for MedicalApplication.
///
public class Form1 : System.Windows.Forms.Form
{
.
.
.
.
.
.
private void button8_Click(object sender, System.EventArgs e)
{
frmAbout frm = new frmAbout();
frm.ShowDialog(this);
frm.Dispose();

// just change the form baout so it reads form 2 then when you press the button it will take you to form 2
}


here's form 2:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace WindowsApplication3
{
///
/// Summary description for ToCreatePatientFileInDatabase.
///
public

[code]
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 17
Reputation: boki is an unknown quantity at this point 
Solved Threads: 0
boki's Avatar
boki boki is offline Offline
Newbie Poster

Re: hi can someone teach me how to link my forms?

 
0
  #3
Sep 1st, 2005
Originally Posted by tayspen
try this im not sure what your asking but i think you want this

[code]

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;


namespace WindowsApplication2

{
///
/// Summary description for MedicalApplication.
///
public class Form1 : System.Windows.Forms.Form
{
.
.
.
.
.
.
private void button8_Click(object sender, System.EventArgs e)
{
frmAbout frm = new frmAbout();
frm.ShowDialog(this);
frm.Dispose();

// just change the form baout so it reads form 2 then when you press the button it will take you to form 2
}


here's form 2:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace WindowsApplication3
{
///
/// Summary description for ToCreatePatientFileInDatabase.
///
public

[code]


tyspen READ, :rolleyes: he want to create a event that means it would have to be like this




private void button8_Click(object sender, System.EventArgs e)
{
string text = textBox1.Text;

if (text == "//your text//")

{
frmAbout frm = new frmAbout();
frm.ShowDialog(this);
frm.Dispose();
}

else

{
MessageBox.Show("error : The key you typed is incorrect");
}


// just change the form baout so it reads form 2 then when you press the button it will take you to form 2
}
using System.Drawing;
using System.Data;
using System;
using System.Net;
using System.Media;
using System.Boki;
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: hi can someone teach me how to link my forms?

 
0
  #4
Sep 1st, 2005
Originally Posted by boki
tyspen READ, :rolleyes: he want to create a event that means it would have to be like this


  1.  
  2. private void button8_Click(object sender, System.EventArgs e)
  3. {
  4. string text = textBox1.Text;
  5.  
  6. if (text == "//your text//")
  7.  
  8. {
  9. frmAbout frm = new frmAbout();
  10. frm.ShowDialog(this);
  11. frm.Dispose();
  12. }
  13.  
  14. // just change the form baout so it reads form 2 then when you press the button it will take you to form 2
  15. }
My bad....
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 17
Reputation: boki is an unknown quantity at this point 
Solved Threads: 0
boki's Avatar
boki boki is offline Offline
Newbie Poster

Re: hi can someone teach me how to link my forms?

 
0
  #5
Sep 1st, 2005
No problem tyspen dont,if you have a idea for project please tell me cause this days i dont have ideas for new projects
using System.Drawing;
using System.Data;
using System;
using System.Net;
using System.Media;
using System.Boki;
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: hi can someone teach me how to link my forms?

 
0
  #6
Sep 1st, 2005
EDIT: (sry didnt mean to post this. Mods please delete)
Last edited by tayspen; Sep 1st, 2005 at 8:55 pm. Reason: Sorry!
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC