G
G.Esmeijer
I'm coming from vb6 and starting with c# now. (a major leap)
I just want to set some properties in a class en and le the class set some
controls on the form
I have a form with on it a textBox (Test) and a button (txtNaam) and another
textBox (txtNaam2)
In the following code I want to fill the property screnheader with the conta
text and with the methode SetScreenHeader I want to put this text as a
formheader. and in the textbox txtNaam2.
The folloing code is behind the form:
But it simple produces nithing as the header of the screen.
WHY NOT : PLEASE HELP
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class frm0000 : System.Windows.Forms.Form
{
public frm0000()
class TestApp
{
public static void Main()
{
Application.Run(new frm0000());
}
}
private void cmdTest_Click(object sender, System.EventArgs e)
{
BuildScreen screen = new BuildScreen();
screen.ScreenHeader = txtNaam.Text;
screen.txtNaam.Text = screen.ScreenHeader;
screen.SetScreenHeader();
}
class BuildScreen
{
protected string screenheader;
protected frm0000 screen = new frm0000();
public string ScreenHeader
{
set { screenheader = value; }
get { return screenheader; }
}
public void SetScreenHeader()
{
screen.txtNaam2.Text = screenheader;
screen.Text = screenheader;
}
}
}
}
I just want to set some properties in a class en and le the class set some
controls on the form
I have a form with on it a textBox (Test) and a button (txtNaam) and another
textBox (txtNaam2)
In the following code I want to fill the property screnheader with the conta
text and with the methode SetScreenHeader I want to put this text as a
formheader. and in the textbox txtNaam2.
The folloing code is behind the form:
But it simple produces nithing as the header of the screen.
WHY NOT : PLEASE HELP
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class frm0000 : System.Windows.Forms.Form
{
public frm0000()
class TestApp
{
public static void Main()
{
Application.Run(new frm0000());
}
}
private void cmdTest_Click(object sender, System.EventArgs e)
{
BuildScreen screen = new BuildScreen();
screen.ScreenHeader = txtNaam.Text;
screen.txtNaam.Text = screen.ScreenHeader;
screen.SetScreenHeader();
}
class BuildScreen
{
protected string screenheader;
protected frm0000 screen = new frm0000();
public string ScreenHeader
{
set { screenheader = value; }
get { return screenheader; }
}
public void SetScreenHeader()
{
screen.txtNaam2.Text = screenheader;
screen.Text = screenheader;
}
}
}
}