views:

72

answers:

1

I'm trying to get the same result of a .NET application (see the link Hide TabControl buttons to manage stacked Panel controls for details), but using the MONO runtime instead of the MS .NET runtime.

Pratically, when the custom control is executed using the MONO runtime, the underlying message is not sent to the control, causing the tab pages to be shown...

Is there a portable solution which is elegant as the linked one? If it is not possible, what are possible workarounds (apart from removing/adding tabs at runtime)?

+1  A: 

I never design UI depends on such "magic".

My preferred approach is,

  1. Design your pages as UserControl instead of TabPage, and set UserControl.Dock = System.Windows.Forms.DockStyle.Fill;
  2. Use Panel instead of TabControl.
  3. Add all UserControl to the panel and set only one of them Visible = true; at a time.

Then this solution is cross platform as no Win32 API is called by you.

Lex Li
Yes, it's a good solution. It would be better to implements an "emulated TabControl" UserControl, but your solution is faster than this.
Luca