Click here to Skip to main content
15,914,165 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to encrypt and decrypt a string Pin
stancrm24-May-06 1:43
stancrm24-May-06 1:43 
QuestionConsoleApplication w/ hidden console Pin
Jonas Beckeman23-May-06 23:05
Jonas Beckeman23-May-06 23:05 
AnswerRe: ConsoleApplication w/ hidden console Pin
Robert Rohde23-May-06 23:17
Robert Rohde23-May-06 23:17 
GeneralRe: ConsoleApplication w/ hidden console Pin
Jonas Beckeman23-May-06 23:28
Jonas Beckeman23-May-06 23:28 
QuestionException of type InvalidActiveXStateException was thrown Pin
satsumatable23-May-06 22:37
satsumatable23-May-06 22:37 
QuestionHow to get the TVTuner Property pages [modified] Pin
ranandbe23-May-06 22:32
ranandbe23-May-06 22:32 
QuestionUsing string as variable name [modified] Pin
Bayli23-May-06 22:14
Bayli23-May-06 22:14 
AnswerRe: Using string as variable name [modified] Pin
S. Senthil Kumar23-May-06 22:29
S. Senthil Kumar23-May-06 22:29 
One way to do it is by using reflection.
FieldInfo fieldInfo = this.GetType().GetField("YourTextBoxVariableHere", BindingFlags.Instance | BindingFlags.NonPublic);
if (fieldInfo != null)
   fieldInfo.SetValue(this, "Your Text Here");


The other way would be to iterate through all the controls in the form and compare the name property to the string you generate. Depending on the number of controls in your form, this might perform better than the previous approach.

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Using string as variable name [modified] Pin
Bayli24-May-06 0:21
Bayli24-May-06 0:21 
AnswerRe: Using string as variable name [modified] Pin
foysal mamun23-May-06 22:33
foysal mamun23-May-06 22:33 
GeneralRe: Using string as variable name [modified] Pin
Bayli24-May-06 0:19
Bayli24-May-06 0:19 
QuestionShow random Form Pin
Greeky23-May-06 22:04
Greeky23-May-06 22:04 
AnswerRe: Show random Form Pin
Robert Rohde23-May-06 22:12
Robert Rohde23-May-06 22:12 
GeneralRe: Show random Form Pin
Greeky25-May-06 2:24
Greeky25-May-06 2:24 
GeneralRe: Show random Form Pin
Robert Rohde25-May-06 4:04
Robert Rohde25-May-06 4:04 
QuestionHandHeld DB setup Pin
Reza Keyvani23-May-06 21:59
Reza Keyvani23-May-06 21:59 
Questionhow to use App.config Pin
foysal mamun23-May-06 21:55
foysal mamun23-May-06 21:55 
AnswerRe: how to use App.config Pin
rah_sin23-May-06 22:31
professionalrah_sin23-May-06 22:31 
AnswerRe: how to use App.config Pin
S. Senthil Kumar23-May-06 22:33
S. Senthil Kumar23-May-06 22:33 
GeneralRe: how to use App.config Pin
foysal mamun23-May-06 22:39
foysal mamun23-May-06 22:39 
GeneralRe: how to use App.config Pin
foysal mamun23-May-06 22:43
foysal mamun23-May-06 22:43 
GeneralRe: how to use App.config Pin
foysal mamun23-May-06 22:52
foysal mamun23-May-06 22:52 
QuestionNeed help in File handling with directory Pin
Ashraj198223-May-06 18:32
Ashraj198223-May-06 18:32 
AnswerRe: Need help in File handling with directory Pin
stancrm23-May-06 20:04
stancrm23-May-06 20:04 
GeneralRe: Need help in File handling with directory Pin
J4amieC23-May-06 21:54
J4amieC23-May-06 21:54 

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.