Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Smart Client Maximize a view in tab workspace

By: a guest on Feb 26th, 2012  |  syntax: None  |  size: 0.78 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. [STAThread]
  2. static void Main()
  3. {
  4.     Application.EnableVisualStyles();
  5.     Button button;
  6.     TextBox textbox;
  7.  
  8.     using (Form form = new Form
  9.     {
  10.         Controls ={
  11.             new TabControl { Dock = DockStyle.Fill, TabPages = {
  12.                 new TabPage { Text = "Tab Page", Controls = {
  13.                     (textbox = new TextBox { Text = "I'm a graph control...",
  14.                         Multiline = true, Dock = DockStyle.Fill})
  15.                 }}
  16.             }},
  17.             (button = new Button { Text = "Maximize", Dock = DockStyle.Bottom }),
  18.     }}) {
  19.         button.Click += delegate
  20.         {
  21.             textbox.Parent.Controls.Remove(textbox);
  22.             form.Controls.Add(textbox);
  23.             textbox.BringToFront();
  24.         };
  25.         Application.Run(form);
  26.     }
  27. }