Guest User

Smart Client Maximize a view in tab workspace

a guest
Feb 26th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment