How to add Items in Winforms comboBox into WPF? -


i want add winforms combobox wpf application. added using windowsformshost, couldn't add items combobox. here xaml code :

xmlns:wf="clr-namespace:system.windows.forms;assembly=system.windows.forms"     <windowsformshost name="mywfh">         <wf:combobox name="mycmb" selectedindexchanged="combobox_selectedindexchanged" >          </wf:combobox>     </windowsformshost>      public window2()     {         initializecomponent();         combobox cb = (combobox)mywfh.child;  // gives error cannot cast         cb.items.add("one");         cb.items.add("two");                 } 

in xaml, can't find way add items. in code behind can't access mycmb, can access mywfh not mycmb.

how add items combobox?

i think trying cast wpf combobox(system.windows.controls.combobox). should cast system.windows.forms.combobox, , can add items or whatever want. btw, why using forms combobox when have wpf combobox?


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -