c# - How to set background to TextBox which is loaded in display mode of ComboBox? -
i found of website having solution edit style combobox popup . please suggest customize background textbox when value selected dropdown of combobox . please find below codes snippet ,
<combobox iseditable="false" x:name="combo" background="red" selectionchanged="combo_selectionchanged" itemssource="{binding record.data.comboitems, mode=twoway,updatesourcetrigger=propertychanged}" selectedvalue="{binding cellboundvalue}" > <combobox.resources> <solidcolorbrush x:key="{x:static systemcolors.highlightbrushkey}">red</solidcolorbrush> </combobox.resources> </combobox>
it sounds need set background property of textbox based on selection of combobox:
<stackpanel orientation="horizontal"> <combobox width="100" height="25" name="mycombobox"> <comboboxitem content="red" /> <comboboxitem content="blue" /> <comboboxitem content="green" /> </combobox> <textbox height="25" width="100" fontsize="16" foreground="white" text="{binding elementname=mycombobox,path=text}" background="{binding elementname=mycombobox,path=text}" /> </stackpanel>
Comments
Post a Comment