Hi all,
Detailed description of the problem as follows:
--SQL Server script:
CREATE TABLE forms_config
(
id int,
namespace_name varchar(50),
class_name varchar(50)
)
// C# codes:
namespace MulLableForms
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
public partial class Form1 : Form
{
}public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){treeView1.Nodes.Add("Main Menu");treeView1.Nodes[0].Nodes.Add("Submenu one");treeView1.Nodes[0].Nodes[0].Nodes.Add("Form2");treeView1.Nodes[0].Nodes[0].Nodes.Add("Form3");treeView1.Nodes[0].Nodes[0].Nodes.Add("Form4");treeView1.Nodes[0].Nodes.Add("Submenu two");treeView1.Nodes[0].Nodes[1].Nodes.Add("Form5");treeView1.Nodes[0].Nodes[1].Nodes.Add("Form6");}private void treeView1_DoubleClick(object sender, EventArgs e){string formName = treeView1.SelectedNode.Text.Trim();string queryFormConfig = @"select namespace_name,class_name from forms_config where class_name='" + formName+"'";/*Now,When I need to double-click the node to load the specified node form, and docked on the right side of the menu.* When I double-click the node to continue, and continue to stop at the right of the menu. Thereby forming a multi-label style. It looks like SQL Server style.* Description: use the reflective technology to dynamically load the specified form.* Reflection parameters are stored in 'forms_config'.* How to do this?*/}
Thanks.

VulpesPosted Dec 7, 2014, 4:43 PM
Ken HPosted Feb 1, 2015, 9:35 PM
VulpesPosted Jan 30, 2015, 5:36 PM
http://www.dotnetthoughts.net/implementing-close-button-in-tab-pages/
Ken HPosted Jan 29, 2015, 8:53 PM
You are correct. Thank for your solution. :)
In addition,How to in each label embedded close icon?
It looks like this:
That would be more perfect.
VulpesPosted Dec 10, 2014, 6:40 PM
Here's some code which adds a new TabPage to a TabControl for each reflection-created form. It doesn't allow you to add the same form more than once.
You'll need, of course, to make sure that the size of your forms and the size of the tab pages are compatible with each other:
Ken HPosted Dec 8, 2014, 8:47 PM
Of course, your idea is very good.You can write a sample procedure?
thank for you.
VulpesPosted Dec 8, 2014, 10:48 AM
If you do, then it would be better to use UserControls rather than Forms as it is much easier to embed the former in tab pages.
Can I also point out that, as you're using reflection, performance is not going to be great whatever you do. To improve matters, you could cache each Form or UserControl object as you create it so you don't have to create a new object of the same class each time it's selected.
Ken HPosted Dec 8, 2014, 3:29 AM
How to achieve the effect of tabs?
such as:each tab that represents a form.It looks like Microsoft SQL Server Managerment Studio style.
Renderings :
Thank for you.