tags:

views:

18

answers:

0

Hi, Im using WPF controls as C# dll in VC++.Im having Tabcontrol with three tab items.Two tabitems contains buttons only and third tab contains Listbox.Im sending data to Listbox from my VC++.So i did coding like this

ref class Globals1
{ 
public:
    static System::Windows::Interop::HwndSource^ gHwndSource;
    static Tabcontrol::ToolBar^ gwtoolbar;     //Main tabcontrol
    static Tabcontrol::PresetTab^ gwpreset;    //Thirdtab

};

void CToolTab::SendPresetmenu(CString menu)
{
    FrameworkElement^ page;
    String ^ msg = gcnew String( menu );
    Globals1::gwpreset->AddPresetmenu(msg); 
    page = Globals1::gwpreset;
    Globals1::gHwndSource->RootVisual = page;
}

By thsi code,wat happend is in my output applcaiton the thirdtab appears with proper data in listbox in entire tabcontrol.No tab headers,other 2 tabitems also. If i commented the last two lines,its comes perfectly but no data in third tab listbox. What can i do for this?