Click here to Skip to main content
15,896,111 members
Home / Discussions / C#
   

C#

 
General.net Variable Naming Conventions Pin
Jayman91119-Oct-04 13:18
Jayman91119-Oct-04 13:18 
GeneralRe: .net Variable Naming Conventions Pin
Steven Campbell19-Oct-04 13:22
Steven Campbell19-Oct-04 13:22 
GeneralRe: .net Variable Naming Conventions Pin
Jayman91119-Oct-04 13:28
Jayman91119-Oct-04 13:28 
GeneralAccessing form controls in code Pin
isittheweekendyet19-Oct-04 12:59
isittheweekendyet19-Oct-04 12:59 
GeneralRe: Accessing form controls in code Pin
Anonymous19-Oct-04 13:25
Anonymous19-Oct-04 13:25 
GeneralRe: Accessing form controls in code Pin
Nick Parker19-Oct-04 13:26
protectorNick Parker19-Oct-04 13:26 
GeneralRe: Accessing form controls in code Pin
isittheweekendyet19-Oct-04 14:34
isittheweekendyet19-Oct-04 14:34 
GeneralRe: Accessing form controls in code Pin
Nick Parker19-Oct-04 15:12
protectorNick Parker19-Oct-04 15:12 
isittheweekendyet wrote:
Not sure if this makes the situation any clearer.

Yes, this helps. First it's important to understand that the following are identical.

static void Main()
{
    Application.Run(new frmMain());
}

static void Main()
{
    frmMain frm = new frmMain();
    frm.ShowDialog();
}

So where are you trying to access a controls property? This is a quick example:

public class test : System.Windows.Forms.Form
{
	Button b;
	Label l;	

	public test()
	{
		l = new Label();
		this.Controls.Add(l);

		b = new Button();
		b.Location = new Point(20, 20);
		b.Click += new EventHandler(bClick);	
		this.Controls.Add(b);
	}

	public static void Main()
	{
		Application.Run(new test());
	}

	private void bClick(object sender, EventArgs e)
	{
            l.Text = "Hello";
         }
}


- Nick Parker
My Blog | My Articles

GeneralRe: Accessing form controls in code Pin
isittheweekendyet20-Oct-04 0:19
isittheweekendyet20-Oct-04 0:19 
GeneralBest practices with password storage/use Pin
econner19-Oct-04 12:01
econner19-Oct-04 12:01 
GeneralRe: Best practices with password storage/use Pin
Nick Parker19-Oct-04 12:52
protectorNick Parker19-Oct-04 12:52 
GeneralRe: Best practices with password storage/use Pin
Steven Campbell19-Oct-04 13:20
Steven Campbell19-Oct-04 13:20 
Generalinsert picture in listbox Pin
hudhud19-Oct-04 10:50
hudhud19-Oct-04 10:50 
GeneralRe: insert picture in listbox Pin
Nick Parker19-Oct-04 15:59
protectorNick Parker19-Oct-04 15:59 
GeneralCompare lines in two large txt files Pin
sverre.andersen19-Oct-04 10:39
sverre.andersen19-Oct-04 10:39 
GeneralRe: Compare lines in two large txt files Pin
Nick Parker19-Oct-04 13:16
protectorNick Parker19-Oct-04 13:16 
GeneralQuestion about Interop with a DLL written in C++ Pin
kmansari19-Oct-04 10:23
kmansari19-Oct-04 10:23 
GeneralRe: Question about Interop with a DLL written in C++ Pin
Heath Stewart19-Oct-04 16:02
protectorHeath Stewart19-Oct-04 16:02 
GeneralRe: Question about Interop with a DLL written in C++ Pin
kmansari20-Oct-04 10:02
kmansari20-Oct-04 10:02 
GeneralRe: Question about Interop with a DLL written in C++ Pin
kmansari20-Oct-04 10:24
kmansari20-Oct-04 10:24 
GeneralRe: Question about Interop with a DLL written in C++ Pin
Heath Stewart20-Oct-04 13:37
protectorHeath Stewart20-Oct-04 13:37 
Generalmessaging in C# Pin
ppp00119-Oct-04 10:01
ppp00119-Oct-04 10:01 
GeneralRe: messaging in C# Pin
Heath Stewart19-Oct-04 15:46
protectorHeath Stewart19-Oct-04 15:46 
GeneralThreading -- Performance Pin
petst19-Oct-04 9:42
petst19-Oct-04 9:42 
GeneralRe: Threading -- Performance Pin
Salil Khedkar19-Oct-04 20:47
Salil Khedkar19-Oct-04 20:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.