Click here to Skip to main content
15,921,212 members
Home / Discussions / C#
   

C#

 
GeneralRe: datatable from Datagrid Pin
Dave Kreskowiak1-Sep-04 1:26
mveDave Kreskowiak1-Sep-04 1:26 
GeneralRe: datatable from Datagrid Pin
sreejith ss nair1-Sep-04 1:39
sreejith ss nair1-Sep-04 1:39 
GeneralMinimize and hide the console window Pin
Md Saleem Navalur30-Aug-04 20:53
Md Saleem Navalur30-Aug-04 20:53 
GeneralRe: Minimize and hide the console window Pin
Nick Parker31-Aug-04 3:17
protectorNick Parker31-Aug-04 3:17 
Generala way to access to all object on the form Pin
TehMedic30-Aug-04 19:29
TehMedic30-Aug-04 19:29 
GeneralRe: a way to access to all object on the form Pin
Corinna John30-Aug-04 20:18
Corinna John30-Aug-04 20:18 
GeneralRe: a way to access to all object on the form Pin
sreejith ss nair30-Aug-04 20:33
sreejith ss nair30-Aug-04 20:33 
GeneralRe: a way to access to all object on the form Pin
Corinna John30-Aug-04 20:43
Corinna John30-Aug-04 20:43 
There is one instance of the TextBox class. You can't access objects directly, you need a variable of the object's type to reference the object.
The first variable is txt. It's a local variable in your example.
Controls.Add(txt) copies the variable, but not the object. That means, you have one object with two references. The first reference is still txt, the second one is the new item in the Controls collection.

If you use the Forms Designer to drag a new component onto a form, it generates code for an instance variable private TextBox txt, and more code to create the object new TextBox(). the variable txt is an instance variable of the form, referencing the TextBox. And there's an additional reference the the TextBox in the Controls collection.
GeneralRe: a way to access to all object on the form Pin
TehMedic30-Aug-04 21:22
TehMedic30-Aug-04 21:22 
GeneralRe: a way to access to all object on the form Pin
Corinna John30-Aug-04 21:37
Corinna John30-Aug-04 21:37 
GeneralRe: a way to access to all object on the form Pin
TehMedic31-Aug-04 1:37
TehMedic31-Aug-04 1:37 
GeneralRe: a way to access to all object on the form Pin
sreejith ss nair30-Aug-04 20:23
sreejith ss nair30-Aug-04 20:23 
GeneralRe: a way to access to all object on the form Pin
Corinna John30-Aug-04 20:32
Corinna John30-Aug-04 20:32 
Question"Shutting down a remote PC? Pin
Salman Taseer`30-Aug-04 18:48
Salman Taseer`30-Aug-04 18:48 
AnswerRe: "Shutting down a remote PC? Pin
Lim Bio Liong30-Aug-04 19:51
Lim Bio Liong30-Aug-04 19:51 
AnswerRe: "Shutting down a remote PC? Pin
Dave Kreskowiak31-Aug-04 5:53
mveDave Kreskowiak31-Aug-04 5:53 
GeneralRe: "Shutting down a remote PC? Pin
Salman Taseer`31-Aug-04 7:13
Salman Taseer`31-Aug-04 7:13 
GeneralPreserving what is drawn to Controls Pin
Member 94235530-Aug-04 15:05
Member 94235530-Aug-04 15:05 
GeneralRe: Preserving what is drawn to Controls Pin
Christian Graus30-Aug-04 15:09
protectorChristian Graus30-Aug-04 15:09 
GeneralRe: Preserving what is drawn to Controls Pin
Joel Lucsy30-Aug-04 17:02
Joel Lucsy30-Aug-04 17:02 
GeneralRe: Preserving what is drawn to Controls Pin
Member 94235531-Aug-04 4:38
Member 94235531-Aug-04 4:38 
GeneralRe: Preserving what is drawn to Controls Pin
Joel Lucsy31-Aug-04 4:46
Joel Lucsy31-Aug-04 4:46 
GeneralRe: Preserving what is drawn to Controls Pin
Member 9423552-Sep-04 0:32
Member 9423552-Sep-04 0:32 
GeneralWhy selected items in a checkedListBox don't show in order Pin
abhishk2001@yahoo.com30-Aug-04 14:50
abhishk2001@yahoo.com30-Aug-04 14:50 
GeneralRe: Why selected items in a checkedListBox don't show in order Pin
Bill Dean30-Aug-04 16:24
Bill Dean30-Aug-04 16:24 

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.