Textchanged is required when you use the ComboBox control of WPF, but this property belongs to the Textbox Control. You don't have to worry about it. There is a textbox in ComboBox, so the key issue is how to find the Textbox Control in ComboBox.
Default ComboBox control composition:
The first layer (1 Control ):
System. Windows. Controls. Grid
Layer 2 (2 controls ):
System. Windows. Controls. primitives. Popup;
Microsoft. Windows. Themes. listboxchrome;
System. Windows. Controls. textbox;
System. Windows. Controls. primitives. togglebutton content: ischecked: false
Controls are arranged in order, so the Textbox Control is obtained as follows:
(Textbox) visualtreehelper. getchild (visualtreehelper. getchild (this. cbserver, 0), 2). textchanged + = new textchangedeventhandler (setdatabaseisenabled );
Note:CodeTo be placed in the window_loaded () event, it cannot be placed in the page constructor.
You can add the textchanged attribute to the ComboBox control.
PS: Find the code of the control in ComboBox:
Private void button#click (Object sender, routedeventargs e) {for (INT I = 0; I <visualtreehelper. getchildrencount (this. cbserver); I ++) {dependencyobject O1 = visualtreehelper. getchild (this. cbserver, I); For (Int J = 0; j <visualtreehelper. getchildrencount (O1); j ++) {dependencyobject O2 = visualtreehelper. getchild (O1, j );}}}