| | |
hi can someone teach me how to link my forms?
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2005
Posts: 38
Reputation:
Solved Threads: 1
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..
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..
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]
[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]
•
•
•
•
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;
using System.Data;
using System;
using System.Net;
using System.Media;
using System.Boki;
•
•
•
•
Originally Posted by boki
tyspen READ, :rolleyes: he want to create a event that means it would have to be like this
C# Syntax (Toggle Plain Text)
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(); } // just change the form baout so it reads form 2 then when you press the button it will take you to form 2 }
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
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
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
![]() |
Similar Threads
- Forms in Random access files (Visual Basic 4 / 5 / 6)
- vBulletin mod_rewrite (PHP)
- please take some time to help me.. thank you very much! (C#)
- Link building tool - fill online forms easily (Promotion and Marketing Plans)
Other Threads in the C# Forum
- Previous Thread: Please help me find problem in code :)
- Next Thread: Remove quotation marks from a CSV file
| Thread Tools | Search this Thread |
.net 7 access algorithm app application array barchart bitmap box broadcast buttons c# cast check checkbox client color combo combobox concurrency control conversion csharp custom data database datagrid datagridview dataset datatable datetime degrees development draganddrop drawing enabled encryption enum event excel file form format forms function gdi+ getoutlookcontactusinfcsvfile globalization httpwebrequest image index input install java label list listbox localization mandelbrot math microsoftc#visualexpress mouseclick mysql operator path photoshop picturebox pixelinversion post problem programming radians regex remote remoting richtextbox server sleep socket sql statistics stream string table text textbox thread time timer update usercontrol validate validation visualstudio webbrowser windows winforms wpf xml






