Friday 15 March 2013

.net - Tabcontrol: How can you remove the tabpage title? -


I have been used to display more than one image file in an application. When I only display one tabpap, I would like to remove the title of TabPep, so I can use that screen space for the image. (This is similar to unchecking "Always show tab bar" in Firefox.)

Is it possible to do with the taborer? Or is it better to use panel control when I open a single file (tab)?

Yes, this is possible. Add a new class to your project and paste the code shown below to compile. Drop new control over your form from the toolbox.

  using the system; Using System.Windows.Forms; Public category MyTabControl: TabControl {Private Int mPages = 0; Private Zero checkonpage () {if (Israelwide) {int pages = mpages; Mpages = this.TabCount; If ((Page == 1 & amp; amp; amp; amp; & amp; 1;); (pages & gt; 1 & amp; amp; amp; amp; amp; amp; ; & Amp; amp; amp; amp; mpages == 1)) This RectateHandle (); }} Safe Override Zero OnControlAdded (ControlEventArgs e) {base.OnControlAdded (e); CheckOnePage (); } Safe Override Zero OnControlRemoved (ControlEventArgs e) {base.OnControlRemoved (e); CheckOnePage (); } Hide the tab by trapping the Safe Override Zero WndProc (Ref message message) {// TCM_ADJUSTRECT message if (m.msg == 0x1328 & DesignMode & this.TabCount == 1) m.Result = (IntPtr) 1; And base Weedproc (Ref M); }}  

No comments:

Post a Comment