Click here to Skip to main content
16,005,128 members
Home / Discussions / C#
   

C#

 
AnswerRe: string to a command Pin
Ravi Bhavnani20-Jul-06 2:20
professionalRavi Bhavnani20-Jul-06 2:20 
GeneralRe: string to a command Pin
Schimaera20-Jul-06 2:24
Schimaera20-Jul-06 2:24 
GeneralRe: string to a command Pin
Schimaera20-Jul-06 2:44
Schimaera20-Jul-06 2:44 
GeneralRe: string to a command Pin
J4amieC20-Jul-06 2:52
J4amieC20-Jul-06 2:52 
GeneralRe: string to a command Pin
Schimaera20-Jul-06 2:57
Schimaera20-Jul-06 2:57 
GeneralRe: string to a command Pin
Schimaera20-Jul-06 3:24
Schimaera20-Jul-06 3:24 
GeneralRe: string to a command [modified] Pin
J4amieC20-Jul-06 3:48
J4amieC20-Jul-06 3:48 
GeneralRe: string to a command Pin
Josh Smith20-Jul-06 4:25
Josh Smith20-Jul-06 4:25 
That code won't work if the target control is in the Controls collection of a container, such as a GroupBox or Panel. You should make a recursive method which iterates ControlCollections searching for a control with the specified name.

An easier way to do this would be to use reflection to get the control by it's name, assuming that the control is not created dynamically. For example:

FieldInfo fi = this.GetType().GetField( "textBoxInfinity", BindingFlags.Instance | BindingFlags.NonPublic );
TextBox txt = fi.GetValue( this ) as TextBox;
txt.Text = "HELLO";


:josh:
My WPF Blog[^]
GeneralRe: string to a command Pin
Schimaera20-Jul-06 4:57
Schimaera20-Jul-06 4:57 
GeneralRe: string to a command Pin
Josh Smith20-Jul-06 5:07
Josh Smith20-Jul-06 5:07 
GeneralRe: string to a command Pin
Schimaera20-Jul-06 5:10
Schimaera20-Jul-06 5:10 
GeneralRe: string to a command Pin
J4amieC20-Jul-06 4:58
J4amieC20-Jul-06 4:58 
GeneralRe: string to a command Pin
Schimaera20-Jul-06 5:02
Schimaera20-Jul-06 5:02 
GeneralRe: string to a command Pin
Josh Smith20-Jul-06 5:13
Josh Smith20-Jul-06 5:13 
GeneralRe: string to a command Pin
Schimaera20-Jul-06 5:19
Schimaera20-Jul-06 5:19 
GeneralRe: string to a command Pin
Schimaera20-Jul-06 4:30
Schimaera20-Jul-06 4:30 
GeneralRe: string to a command Pin
_AK_20-Jul-06 2:22
_AK_20-Jul-06 2:22 
AnswerRe: string to a command Pin
albCode20-Jul-06 2:10
albCode20-Jul-06 2:10 
AnswerRe: string to a command Pin
Eran Aharonovich20-Jul-06 3:38
Eran Aharonovich20-Jul-06 3:38 
QuestionData Storing in Global Variables in C# Project Pin
Ajay Kapil20-Jul-06 1:56
Ajay Kapil20-Jul-06 1:56 
AnswerRe: Data Storing in Global Variables in C# Project Pin
Ravi Bhavnani20-Jul-06 2:06
professionalRavi Bhavnani20-Jul-06 2:06 
QuestionAccess a PHP web service in C#.NET 2003 ? Pin
Jyotsna.Sonawane20-Jul-06 1:54
Jyotsna.Sonawane20-Jul-06 1:54 
AnswerRe: Access a PHP web service in C#.NET 2003 ? Pin
Jyotsna.Sonawane20-Jul-06 3:40
Jyotsna.Sonawane20-Jul-06 3:40 
GeneralRe:Access a PHP web service in C#.NET 2003 ? Pin
karthik4u26-Aug-09 3:38
karthik4u26-Aug-09 3:38 
Questioni have error Pin
TAREQ F ABUZUHRI20-Jul-06 1:27
TAREQ F ABUZUHRI20-Jul-06 1:27 

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.