Click here to Skip to main content
15,887,683 members
Home / Discussions / C#
   

C#

 
QuestionMessage Removed Pin
3-Feb-10 7:08
attalurisubbu3-Feb-10 7:08 
AnswerRe: Need to display the page number as "2" from second page Onwards. Pin
Not Active3-Feb-10 7:37
mentorNot Active3-Feb-10 7:37 
Questiontrying to understand classes and threads using the progress bar in c# Pin
tonyonlinux3-Feb-10 6:15
tonyonlinux3-Feb-10 6:15 
AnswerRe: trying to understand classes and threads using the progress bar in c# Pin
Luc Pattyn3-Feb-10 6:28
sitebuilderLuc Pattyn3-Feb-10 6:28 
GeneralRe: trying to understand classes and threads using the progress bar in c# Pin
Not Active3-Feb-10 6:33
mentorNot Active3-Feb-10 6:33 
GeneralRe: trying to understand classes and threads using the progress bar in c# Pin
Luc Pattyn3-Feb-10 6:42
sitebuilderLuc Pattyn3-Feb-10 6:42 
GeneralRe: trying to understand classes and threads using the progress bar in c# Pin
tonyonlinux3-Feb-10 10:18
tonyonlinux3-Feb-10 10:18 
QuestionHow to bind control’s properties to variables in C#? Pin
PomaPomaPoma3-Feb-10 5:48
PomaPomaPoma3-Feb-10 5:48 
I have form with lot's of TextBoxes and also there is a lot of threads in my program that need to read content's of those TextBoxes (settings). Since I can't access controls from other threads, I decided to make special class that will hold all the settings, and if user changes some, control will invoke OnTextChanged event and change corresponding value in class. But if I use that approach there will be a lot of similar handlers tike this

private void txtCrap1_TextChanged(object sender, EventArgs e) 
{ 
    Settings.Crap1 = txtCrap1.Text; 
} 

What I want is to do something like this

private void SetUpControlBindings() 
{ 
    AddBinding(txtCrap1, Settings.Crap1); 
    AddBinding(txtCrap2, Settings.Crap2); 
} 
private void AddBinding(object control, object value) 
{ 
    //Add entry to some kind of dictionary 
} 
private void UpdateValue(object sender, EventArgs e) 
{ 
    if (sender is TextBox) 
    { 
    //Search it in dictionary and change appropriate value 
    } 
} 

But I can't find any pointers to variables in C# Any ideas how to do this?
Actually my program is a bit more complicated. I have not only textboxes, but CheckBoxes, NumericUpDowns etc. also I want my Settings class to hold some additional objects like Lists.

P.S. I can't use reflection since my code will be obfuscated after compilation
AnswerRe: How to bind control’s properties to variables in C#? Pin
Luc Pattyn3-Feb-10 9:23
sitebuilderLuc Pattyn3-Feb-10 9:23 
GeneralRe: How to bind control’s properties to variables in C#? Pin
PomaPomaPoma3-Feb-10 9:52
PomaPomaPoma3-Feb-10 9:52 
GeneralRe: How to bind control’s properties to variables in C#? Pin
Luc Pattyn3-Feb-10 9:59
sitebuilderLuc Pattyn3-Feb-10 9:59 
GeneralRe: How to bind control’s properties to variables in C#? Pin
PomaPomaPoma3-Feb-10 11:12
PomaPomaPoma3-Feb-10 11:12 
AnswerRe: How to bind control’s properties to variables in C#? Pin
Not Active3-Feb-10 9:32
mentorNot Active3-Feb-10 9:32 
GeneralRe: How to bind control’s properties to variables in C#? Pin
PomaPomaPoma3-Feb-10 10:09
PomaPomaPoma3-Feb-10 10:09 
GeneralRe: How to bind control’s properties to variables in C#? Pin
Not Active3-Feb-10 10:17
mentorNot Active3-Feb-10 10:17 
QuestionC# code clean up and improvement Pin
eeffoc423-Feb-10 5:20
eeffoc423-Feb-10 5:20 
AnswerRe: C# code clean up and improvement Pin
Luc Pattyn3-Feb-10 5:26
sitebuilderLuc Pattyn3-Feb-10 5:26 
GeneralRe: C# code clean up and improvement [modified] Pin
eeffoc423-Feb-10 5:50
eeffoc423-Feb-10 5:50 
GeneralRe: C# code clean up and improvement Pin
Luc Pattyn3-Feb-10 6:26
sitebuilderLuc Pattyn3-Feb-10 6:26 
GeneralRe: C# code clean up and improvement Pin
eeffoc423-Feb-10 9:17
eeffoc423-Feb-10 9:17 
GeneralRe: C# code clean up and improvement Pin
Luc Pattyn3-Feb-10 9:54
sitebuilderLuc Pattyn3-Feb-10 9:54 
AnswerRe: C# code clean up and improvement Pin
Md. Marufuzzaman3-Feb-10 6:27
professionalMd. Marufuzzaman3-Feb-10 6:27 
Questionasalamalikum! Pin
ayeshazahoor3-Feb-10 4:43
ayeshazahoor3-Feb-10 4:43 
Questionhello every one Pin
japrasath3-Feb-10 4:03
japrasath3-Feb-10 4:03 
AnswerRe: hello every one Pin
tonyonlinux3-Feb-10 4:13
tonyonlinux3-Feb-10 4:13 

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.