Click here to Skip to main content
15,886,851 members

Comments by KEL3 (Top 6 by date)

KEL3 3-Nov-12 9:25am View    
Thank you all.
Finally, I decided to go with the OnRender() approach and add a property in a derived class that returns the inner TextBox (as MS should have done). It saves memory and complexity (I think).
KEL3 2-Nov-12 10:11am View    
I don't see a any "comboBox1.TextBox" either. That's the problem.
I guess I must do the trick inside the OnRender() override function... :(
KEL3 2-Nov-12 8:25am View    
You mean that you want countTrue to return 1 when data contains "W" else return 0 ?
If you write a normal for/foreach loop that does what you want perhaps I could give you the LINQ equivalent (if it exists).
Or give examples of input and output.

You say:
data={"W","H","X","V"} => return 3
data={"O","H","X","V"} => return 1
???

I don't understand what is countTrue() supposed to count...
KEL3 2-Nov-12 6:27am View    
Oups! My bad!
I CAN get the new value (I just do (e.OriginalSource as TextBox).Text). Forget what I said before.
The problem is how to set the event handler by code.
There doesn't seem to be any comboBox1.TextChanged.
KEL3 2-Nov-12 6:08am View    
Unfortunately not.
This is mostly a problem for ComboBoxes with the IsEditable property set to true.
There is a problem with ComboBox and when the event handler for TextChanged gets called (when you edit the text contents of it by typing inside it) you cannot see the new Text value (you see the value before modification).

This is a related discussion:
http://social.msdn.microsoft.com/Forums/en/wpf/thread/bf7de95a-b088-48e9-989f-d5f9e3a857da

Textboxbase.Textchanged solves a lot of problems, but I have problems accessing it by code...