{"id":375,"date":"2011-06-21T17:22:06","date_gmt":"2011-06-21T15:22:06","guid":{"rendered":"http:\/\/hen.co.za\/blog\/?p=375"},"modified":"2011-06-22T10:30:51","modified_gmt":"2011-06-22T08:30:51","slug":"tab-control","status":"publish","type":"post","link":"https:\/\/hen.co.za\/blog\/2011\/06\/tab-control\/","title":{"rendered":"Tab control"},"content":{"rendered":"<p>I&#8217;ve come across a tab control that I can customize for my needs in creating a MDI window replacement. It is based on the <a title=\"KRBTabControl\" href=\"http:\/\/www.codeproject.com\/KB\/tabs\/KRBTabControl.aspx\" target=\"_blank\">KRBTabControl<\/a> article from Karub Yaz?l?m on CodeProject.<\/p>\n<p>I&#8217;ve added some built-in context menu that adds a few options for closing a tab, closing all tabs, closing all other tabs and view a list of the available tabs from a modal dialog window. The rest is pretty much the original control except for some enums that I moved around.<\/p>\n<p>My version can be found <a title=\"HenITTabControlTest.zip\" href=\"http:\/\/www.hen.co.za\/downloads\/HenITTabControlTest.zip\" target=\"_blank\">here<\/a>.<\/p>\n<p>* Update *<\/p>\n<p>I&#8217;ve added an event to the control to fire when a tab page get removed. The code to achieve this looks like this:<\/p>\n<blockquote><p><span style=\"color: #0000ff;\">public event TabPageRemovedDelegate <\/span>TabPageRemoved;<br \/>\n<span style=\"color: #0000ff;\"> private void<\/span> RaiseTabPageRemoved(<span style=\"color: #0000ff;\">TabPageEx <\/span>tab)<br \/>\n{<\/p>\n<p style=\"padding-left: 30px;\">if (TabPageRemoved != null)<\/p>\n<p style=\"padding-left: 60px;\">TabPageRemoved(tab);<\/p>\n<p>}<\/p><\/blockquote>\n<p>The &#8216;RaiseTabPageRemoved&#8217; method then gets called from the main OnMouseClick plus my new context menu events to close tabs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve come across a tab control that I can customize for my needs in creating a MDI window replacement. It is based on the KRBTabControl article from Karub Yaz?l?m on CodeProject. I&#8217;ve added some built-in context menu that adds a &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/hen.co.za\/blog\/2011\/06\/tab-control\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[7,8,9,303,20,10],"class_list":["post-375","post","type-post","status-publish","format-standard","hentry","category-development","tag-net","tag-c","tag-code","tag-development","tag-mdi","tag-winforms"],"_links":{"self":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/comments?post=375"}],"version-history":[{"count":3,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/375\/revisions"}],"predecessor-version":[{"id":379,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/375\/revisions\/379"}],"wp:attachment":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/media?parent=375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/categories?post=375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/tags?post=375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}