Hi,
This is the code how is generated by virtual studio for a Form
In "MyFormName.cs" we have :
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;
using System.IO;
namespace Import_Selected_DET
{
public partial class Interface_LIB : Form
{
//My Var
public Interface_LIB()
{
InitializeComponent();
}
In "MyFormName.Designer.cs" we have :
namespace Import_Selected_DET
{
partial class Interface_LIB
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Interface_LIB));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.ListeFAB = new System.Windows.Forms.ComboBox();
this.ListeGAM = new System.Windows.Forms.ComboBox();
this.ListeREP = new System.Windows.Forms.ComboBox();
this.ListDET = new System.Windows.Forms.ListBox();
this.btnImport = new System.Windows.Forms.Button();
this.btnBiblio = new System.Windows.Forms.Button();
this.btnClose = new System.Windows.Forms.Button();
this.btnImportPlace = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtRecherche = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.btnStart = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Century", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(6, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(185, 23);
this.label1.TabIndex = 0;
this.label1.Text = "Choix du fabricant :";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Century", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(6, 121);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(190, 23);
this.label2.TabIndex = 1;
this.label2.Text = "Choix de la gamme :";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Century", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(6, 230);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(193, 23);
this.label3.TabIndex = 2;
this.label3.Text = "Choix du répertoire :";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Century", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.Location = new System.Drawing.Point(282, 16);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(267, 23);
this.label4.TabIndex = 3;
this.label4.Text = "Choix de l\'élément de détail :";
//
// ListeFAB
//
this.ListeFAB.Font = new System.Drawing.Font("Century", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ListeFAB.FormattingEnabled = true;
this.ListeFAB.Location = new System.Drawing.Point(5, 51);
this.ListeFAB.Name = "ListeFAB";
this.ListeFAB.Size = new System.Drawing.Size(186, 23);
this.ListeFAB.TabIndex = 4;
this.ListeFAB.SelectedIndexChanged += new System.EventHandler(this.ListeFAB_SelectedIndexChanged);
//
// ListeGAM
//
this.ListeGAM.Font = new System.Drawing.Font("Century", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ListeGAM.FormattingEnabled = true;
this.ListeGAM.Location = new System.Drawing.Point(6, 156);
this.ListeGAM.Name = "ListeGAM";
this.ListeGAM.Size = new System.Drawing.Size(186, 23);
this.ListeGAM.TabIndex = 5;
this.ListeGAM.SelectedIndexChanged += new System.EventHandler(this.ListeGAM_SelectedIndexChanged);
//
// ListeREP
//
this.ListeREP.Font = new System.Drawing.Font("Century", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ListeREP.FormattingEnabled = true;
this.ListeREP.Location = new System.Drawing.Point(5, 265);
this.ListeREP.Name = "ListeREP";
this.ListeREP.Size = new System.Drawing.Size(186, 23);
this.ListeREP.TabIndex = 6;
this.ListeREP.SelectedIndexChanged += new System.EventHandler(this.ListeREP_SelectedIndexChanged);
//
// ListDET
//
this.ListDET.FormattingEnabled = true;
this.ListDET.Location = new System.Drawing.Point(286, 81);
this.ListDET.Name = "ListDET";
this.ListDET.Size = new System.Drawing.Size(397, 433);
this.ListDET.TabIndex = 7;
this.ListDET.SelectedIndexChanged += new System.EventHandler(this.ListDET_SelectedIndexChanged);
//
// btnImport
//
this.btnImport.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.btnImport.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnImport.ForeColor = System.Drawing.SystemColors.HotTrack;
this.btnImport.Location = new System.Drawing.Point(6, 420);
this.btnImport.Name = "btnImport";
this.btnImport.Size = new System.Drawing.Size(186, 44);
this.btnImport.TabIndex = 8;
this.btnImport.Text = "Importer";
this.btnImport.UseVisualStyleBackColor = false;
this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
//
// btnBiblio
//
this.btnBiblio.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.btnBiblio.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnBiblio.ForeColor = System.Drawing.SystemColors.HotTrack;
this.btnBiblio.Location = new System.Drawing.Point(218, 12);
this.btnBiblio.Name = "btnBiblio";
this.btnBiblio.Size = new System.Drawing.Size(279, 23);
this.btnBiblio.TabIndex = 9;
this.btnBiblio.Text = "Changer emplacement bibliothèque";
this.btnBiblio.UseVisualStyleBackColor = false;
this.btnBiblio.Click += new System.EventHandler(this.btnBiblio_Click);
//
// btnClose
//
this.btnClose.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnClose.Font = new System.Drawing.Font("Century", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnClose.ForeColor = System.Drawing.Color.Red;
this.btnClose.Location = new System.Drawing.Point(503, 12);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(200, 23);
this.btnClose.TabIndex = 11;
this.btnClose.Text = "Close Plug-in";
this.btnClose.UseVisualStyleBackColor = false;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnImportPlace
//
this.btnImportPlace.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.btnImportPlace.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnImportPlace.ForeColor = System.Drawing.SystemColors.HotTrack;
this.btnImportPlace.Location = new System.Drawing.Point(6, 470);
this.btnImportPlace.Name = "btnImportPlace";
this.btnImportPlace.Size = new System.Drawing.Size(186, 44);
this.btnImportPlace.TabIndex = 12;
this.btnImportPlace.Text = "Importer et placer";
this.btnImportPlace.UseVisualStyleBackColor = false;
this.btnImportPlace.Click += new System.EventHandler(this.btnImportPlace_Click);
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.SystemColors.Control;
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtRecherche);
this.groupBox1.Controls.Add(this.btnImportPlace);
this.groupBox1.Controls.Add(this.ListDET);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.btnImport);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.ListeREP);
this.groupBox1.Controls.Add(this.ListeFAB);
this.groupBox1.Controls.Add(this.ListeGAM);
this.groupBox1.Location = new System.Drawing.Point(12, 52);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(689, 529);
this.groupBox1.TabIndex = 13;
this.groupBox1.TabStop = false;
//
// txtRecherche
//
this.txtRecherche.Location = new System.Drawing.Point(357, 49);
this.txtRecherche.Name = "txtRecherche";
this.txtRecherche.Size = new System.Drawing.Size(326, 20);
this.txtRecherche.TabIndex = 13;
this.txtRecherche.TextChanged += new System.EventHandler(this.txtRecherche_TextChanged);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Century", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label5.Location = new System.Drawing.Point(283, 51);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(68, 15);
this.label5.TabIndex = 14;
this.label5.Text = "Recherche :";
//
// btnStart
//
this.btnStart.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnStart.Font = new System.Drawing.Font("Century", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnStart.ForeColor = System.Drawing.Color.Green;
this.btnStart.Location = new System.Drawing.Point(12, 12);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(200, 23);
this.btnStart.TabIndex = 14;
this.btnStart.Text = "Start Plug-in";
this.btnStart.UseVisualStyleBackColor = false;
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// Interface_LIB
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(715, 593);
this.Controls.Add(this.btnStart);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.btnBiblio);
this.Controls.Add(this.groupBox1);
this.Cursor = System.Windows.Forms.Cursors.Default;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Interface_LIB";
this.Text = "Let it BIM - Selection d\'éléments de détail";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox ListeFAB;
private System.Windows.Forms.ComboBox ListeGAM;
private System.Windows.Forms.ComboBox ListeREP;
private System.Windows.Forms.ListBox ListDET;
private System.Windows.Forms.Button btnImport;
private System.Windows.Forms.Button btnBiblio;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnImportPlace;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtRecherche;
private System.Windows.Forms.Button btnStart;
}
}
And then, you already see the code to start Addin.
For more information, My Form is called "Interface_LIB" and the Program in virtual studio is "Import_Selected_DET".