Form1.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:4k
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Data;
- namespace TestHarness
- {
- /// <summary>
- /// Summary description for Form1.
- /// </summary>
- public class Form1 : System.Windows.Forms.Form
- {
- private System.Windows.Forms.Button btnGetSel;
- private System.Windows.Forms.Button btnRoot;
- private System.Windows.Forms.TextBox txtRoot;
- private FolderTree.FolderTree folderTree1;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
- public Form1()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
- }
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if (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()
- {
- this.btnGetSel = new System.Windows.Forms.Button();
- this.btnRoot = new System.Windows.Forms.Button();
- this.txtRoot = new System.Windows.Forms.TextBox();
- this.folderTree1 = new FolderTree.FolderTree();
- ((System.ComponentModel.ISupportInitialize)(this.folderTree1)).BeginInit();
- this.SuspendLayout();
- //
- // btnGetSel
- //
- this.btnGetSel.Location = new System.Drawing.Point(216, 32);
- this.btnGetSel.Name = "btnGetSel";
- this.btnGetSel.Size = new System.Drawing.Size(80, 23);
- this.btnGetSel.TabIndex = 1;
- this.btnGetSel.Text = "Get Selected";
- this.btnGetSel.Click += new System.EventHandler(this.btnGetSel_Click);
- //
- // btnRoot
- //
- this.btnRoot.Location = new System.Drawing.Point(216, 88);
- this.btnRoot.Name = "btnRoot";
- this.btnRoot.TabIndex = 2;
- this.btnRoot.Text = "Set Root";
- this.btnRoot.Click += new System.EventHandler(this.btnRoot_Click);
- //
- // txtRoot
- //
- this.txtRoot.Location = new System.Drawing.Point(192, 136);
- this.txtRoot.Name = "txtRoot";
- this.txtRoot.Size = new System.Drawing.Size(136, 20);
- this.txtRoot.TabIndex = 3;
- this.txtRoot.Text = "";
- //
- // folderTree1
- //
- this.folderTree1.ImageIndex = -1;
- this.folderTree1.Location = new System.Drawing.Point(16, 16);
- this.folderTree1.Name = "folderTree1";
- this.folderTree1.SelectedImageIndex = -1;
- this.folderTree1.Size = new System.Drawing.Size(160, 256);
- this.folderTree1.TabIndex = 4;
- //
- // Form1
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(344, 301);
- this.Controls.Add(this.folderTree1);
- this.Controls.Add(this.txtRoot);
- this.Controls.Add(this.btnRoot);
- this.Controls.Add(this.btnGetSel);
- this.Name = "Form1";
- this.Text = "Form1";
- ((System.ComponentModel.ISupportInitialize)(this.folderTree1)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.Run(new Form1());
- }
- private void btnGetSel_Click(object sender, System.EventArgs e)
- {
- MessageBox.Show(folderTree1.SelectedFolder);
- }
- private void btnRoot_Click(object sender, System.EventArgs e)
- {
- folderTree1.RootFolder = txtRoot.Text;
- }
- }
- }