About tabPanel, wstring.

I was trying some ways to select tabPage (panel) knowing only its id (tabPage1, tabPage2...).

For example:

1
2
3
System::Windows::Forms::TabPage^ tabbed;
std::wstring tabsx[] = {L"tabPage1", L"tabPage2"};
tabbed = tabsx[0];


This one gives me cannot convert from 'std::wstring' to 'System::Windows::Forms::TabPage ^' error. Any ideas?


Also tried
System::Windows::Forms::TabPage^ pages[] = {tabPage1, tabPage2};
Error: 'System::Windows::Forms::TabPage ^' : a native array cannot contain this managed type
Did you mean 'array<System::Windows::Forms::TabPage ^>'

I am really messed up, I want to change attribute of tabPage1 only knowing the number 1.

Any help?
From experience, you might want to try the MSDN Forums: http://social.msdn.microsoft.com/Forums. This forum's experts (I'm not one of those) are usually pure C++ and no .Net. I mean, they do know .Net, but they usually don't use it with C++.

Hope you get an answer, though!

P. S.: Venturing in the unknown, and assuming things I really don't know, I will point out that you are trying to assign a string to a managed object. Is that even allowed? If those were C++ types, you would require an operator=() overload. Is .Net supposed to translate wstring automatically?
Topic archived. No new replies allowed.