Nov 12, 2011

tabControl as form main




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form2 f = new Form2();
            f.TopLevel = false;
            f.FormBorderStyle = FormBorderStyle.None;
            TabPage tp = new TabPage();
            tp.Text = f.Text;
            f.Parent = tp;
            tabControl1.TabPages.Add(tp);
            f.Show();
        }
    }
}



0 comments:

Post a Comment

Nam Le © 2014 - Designed by Templateism.com, Distributed By Templatelib