开发者

WinAPI magic and MONO runtime

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 inste开发者_如何转开发ad 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)?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜