M
MikeY
Hiya all,
I am developing a windows form application. I am coding in C#. What I have
is two forms/Classes, frmMain & frmAdd. In frmMain I have initialize &
instantiated my variable as "public string userName", where I have inputted
a user name. I am trying to get at this data from my frmMain to my frmAdd. I
thought this is the correct syntex for outputting the info in my textbox
(scratching my head), maybe it's not. So please let me know if you can help
or where I'm going wrong. Code is as follows:
namespace Q.A._Testing_Centre
{
public class frmMain : System.Windows.Forms.Form
{
public string userName; <<<---- I want the data from here
....
....
....
namespace Q.A._Testing_Centre
{
public class frmAdd : System.Windows.Forms.Form
{
private void SubMainMenu()
{
frmAdd Main = new frmMain();
txtBoxSample.Text = Convert.ToString(Main.userName);<<<--- to output in my
textbox here
....
....
....
Or maybe if someone has a better alternative, please feel free to let me
know. All help is truly appreciated & thank you all in advance.
MikeY
I am developing a windows form application. I am coding in C#. What I have
is two forms/Classes, frmMain & frmAdd. In frmMain I have initialize &
instantiated my variable as "public string userName", where I have inputted
a user name. I am trying to get at this data from my frmMain to my frmAdd. I
thought this is the correct syntex for outputting the info in my textbox
(scratching my head), maybe it's not. So please let me know if you can help
or where I'm going wrong. Code is as follows:
namespace Q.A._Testing_Centre
{
public class frmMain : System.Windows.Forms.Form
{
public string userName; <<<---- I want the data from here
....
....
....
namespace Q.A._Testing_Centre
{
public class frmAdd : System.Windows.Forms.Form
{
private void SubMainMenu()
{
frmAdd Main = new frmMain();
txtBoxSample.Text = Convert.ToString(Main.userName);<<<--- to output in my
textbox here
....
....
....
Or maybe if someone has a better alternative, please feel free to let me
know. All help is truly appreciated & thank you all in advance.
MikeY