home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / netxp / netxp.exe / Samples / CS / Controls / Form1.cs < prev    next >
Encoding:
Text File  |  2004-04-09  |  12.9 KB  |  317 lines

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7.  
  8. namespace Controls
  9. {
  10.     /// <summary>
  11.     /// Summary description for Form1.
  12.     /// </summary>
  13.     public class Form1 : System.Windows.Forms.Form
  14.     {
  15.         private NETXP.Controls.XPButton xpButton1;
  16.         private NETXP.Controls.XPButton xpButton2;
  17.         private NETXP.Controls.DropDownTreeView dropDownTreeView1;
  18.         private System.Windows.Forms.ImageList imageList1;
  19.         private NETXP.Controls.ColorButton colorButton1;
  20.         private NETXP.Controls.AutoTextBox autoTextBox1;
  21.         private NETXP.Controls.ComboBoxEx comboBoxEx1;
  22.         private NETXP.Controls.Graph graph1;
  23.         private NETXP.Controls.MaskedTextBox maskedTextBox1;
  24.         private NETXP.Controls.SkinnedPanel skinnedPanel1;
  25.         private NETXP.Controls.XPGroupBox xpGroupBox1;
  26.         private NETXP.Controls.XPCheckBox xpCheckBox1;
  27.         private NETXP.Controls.XPButton xpButton3;
  28.         private NETXP.Controls.XPButton xpButton4;
  29.         private System.ComponentModel.IContainer components;
  30.  
  31.         public Form1()
  32.         {
  33.             //
  34.             // Required for Windows Form Designer support
  35.             //
  36.             InitializeComponent();
  37.         }
  38.  
  39.         /// <summary>
  40.         /// Clean up any resources being used.
  41.         /// </summary>
  42.         protected override void Dispose( bool disposing )
  43.         {
  44.             if( disposing )
  45.             {
  46.                 if (components != null) 
  47.                 {
  48.                     components.Dispose();
  49.                 }
  50.             }
  51.             base.Dispose( disposing );
  52.         }
  53.  
  54.         #region Windows Form Designer generated code
  55.         /// <summary>
  56.         /// Required method for Designer support - do not modify
  57.         /// the contents of this method with the code editor.
  58.         /// </summary>
  59.         private void InitializeComponent()
  60.         {
  61.             this.components = new System.ComponentModel.Container();
  62.             System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
  63.             this.xpButton1 = new NETXP.Controls.XPButton();
  64.             this.xpButton2 = new NETXP.Controls.XPButton();
  65.             this.dropDownTreeView1 = new NETXP.Controls.DropDownTreeView();
  66.             this.imageList1 = new System.Windows.Forms.ImageList(this.components);
  67.             this.colorButton1 = new NETXP.Controls.ColorButton();
  68.             this.autoTextBox1 = new NETXP.Controls.AutoTextBox();
  69.             this.comboBoxEx1 = new NETXP.Controls.ComboBoxEx();
  70.             this.graph1 = new NETXP.Controls.Graph();
  71.             this.maskedTextBox1 = new NETXP.Controls.MaskedTextBox();
  72.             this.skinnedPanel1 = new NETXP.Controls.SkinnedPanel();
  73.             this.xpGroupBox1 = new NETXP.Controls.XPGroupBox();
  74.             this.xpCheckBox1 = new NETXP.Controls.XPCheckBox();
  75.             this.xpButton3 = new NETXP.Controls.XPButton();
  76.             this.xpButton4 = new NETXP.Controls.XPButton();
  77.             this.skinnedPanel1.SuspendLayout();
  78.             this.xpGroupBox1.SuspendLayout();
  79.             this.SuspendLayout();
  80.             // 
  81.             // xpButton1
  82.             // 
  83.             this.xpButton1.Image = ((System.Drawing.Image)(resources.GetObject("xpButton1.Image")));
  84.             this.xpButton1.Location = new System.Drawing.Point(136, 48);
  85.             this.xpButton1.Name = "xpButton1";
  86.             this.xpButton1.Size = new System.Drawing.Size(192, 48);
  87.             this.xpButton1.TabIndex = 0;
  88.             this.xpButton1.Text = "Click here for a surprise";
  89.             this.xpButton1.Click += new System.EventHandler(this.xpButton1_Click);
  90.             // 
  91.             // xpButton2
  92.             // 
  93.             this.xpButton2.Location = new System.Drawing.Point(400, 120);
  94.             this.xpButton2.Name = "xpButton2";
  95.             this.xpButton2.Size = new System.Drawing.Size(136, 40);
  96.             this.xpButton2.TabIndex = 1;
  97.             this.xpButton2.Text = "xpButton2";
  98.             this.xpButton2.Click += new System.EventHandler(this.xpButton2_Click);
  99.             // 
  100.             // dropDownTreeView1
  101.             // 
  102.             this.dropDownTreeView1.Controls.Add(this.dropDownTreeView1.TreeView);
  103.             this.dropDownTreeView1.Location = new System.Drawing.Point(336, 48);
  104.             this.dropDownTreeView1.Name = "dropDownTreeView1";
  105.             this.dropDownTreeView1.Size = new System.Drawing.Size(216, 22);
  106.             this.dropDownTreeView1.TabIndex = 2;
  107.             // 
  108.             // dropDownTreeView1.TreeView
  109.             // 
  110.             this.dropDownTreeView1.TreeView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  111.             this.dropDownTreeView1.TreeView.ImageList = this.imageList1;
  112.             this.dropDownTreeView1.TreeView.Indent = 10;
  113.             this.dropDownTreeView1.TreeView.Location = new System.Drawing.Point(0, 0);
  114.             this.dropDownTreeView1.TreeView.Name = "";
  115.             this.dropDownTreeView1.TreeView.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
  116.                                                                                                    new System.Windows.Forms.TreeNode("My Computer", 2, 2, new System.Windows.Forms.TreeNode[] {
  117.                                                                                                                                                                                                   new System.Windows.Forms.TreeNode("System (C:)", 1, 1, new System.Windows.Forms.TreeNode[] {
  118.                                                                                                                                                                                                                                                                                                  new System.Windows.Forms.TreeNode("Windows", new System.Windows.Forms.TreeNode[] {
  119.                                                                                                                                                                                                                                                                                                                                                                                       new System.Windows.Forms.TreeNode("System")}),
  120.                                                                                                                                                                                                                                                                                                  new System.Windows.Forms.TreeNode("Temp", new System.Windows.Forms.TreeNode[] {
  121.                                                                                                                                                                                                                                                                                                                                                                                    new System.Windows.Forms.TreeNode("File.ext", 3, 3)})}),
  122.                                                                                                                                                                                                   new System.Windows.Forms.TreeNode("Data (D:)", 1, 1, new System.Windows.Forms.TreeNode[] {
  123.                                                                                                                                                                                                                                                                                                new System.Windows.Forms.TreeNode("Projects", new System.Windows.Forms.TreeNode[] {
  124.                                                                                                                                                                                                                                                                                                                                                                                      new System.Windows.Forms.TreeNode("Main.exe", 3, 3),
  125.                                                                                                                                                                                                                                                                                                                                                                                      new System.Windows.Forms.TreeNode("Readme.txt", 3, 3)}),
  126.                                                                                                                                                                                                                                                                                                new System.Windows.Forms.TreeNode("Software")})})});
  127.             this.dropDownTreeView1.TreeView.ShowLines = false;
  128.             this.dropDownTreeView1.TreeView.ShowPlusMinus = false;
  129.             this.dropDownTreeView1.TreeView.ShowRootLines = false;
  130.             this.dropDownTreeView1.TreeView.Size = new System.Drawing.Size(0, 150);
  131.             this.dropDownTreeView1.TreeView.TabIndex = 2;
  132.             this.dropDownTreeView1.TreeView.Visible = false;
  133.             // 
  134.             // imageList1
  135.             // 
  136.             this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
  137.             this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
  138.             this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
  139.             this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
  140.             // 
  141.             // colorButton1
  142.             // 
  143.             this.colorButton1.CenterColor = System.Drawing.Color.Red;
  144.             this.colorButton1.Location = new System.Drawing.Point(336, 80);
  145.             this.colorButton1.Name = "colorButton1";
  146.             this.colorButton1.Size = new System.Drawing.Size(88, 23);
  147.             this.colorButton1.TabIndex = 3;
  148.             // 
  149.             // autoTextBox1
  150.             // 
  151.             this.autoTextBox1.AutoCompleteHeader = "Test";
  152.             this.autoTextBox1.Location = new System.Drawing.Point(24, 48);
  153.             this.autoTextBox1.Name = "autoTextBox1";
  154.             this.autoTextBox1.Size = new System.Drawing.Size(104, 21);
  155.             this.autoTextBox1.TabIndex = 4;
  156.             this.autoTextBox1.Text = "autoTextBox1";
  157.             // 
  158.             // comboBoxEx1
  159.             // 
  160.             this.comboBoxEx1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
  161.             this.comboBoxEx1.Flags = ((NETXP.Controls.AutoCompleteFlags)(((NETXP.Controls.AutoCompleteFlags.FileSystem | NETXP.Controls.AutoCompleteFlags.URLHistory) 
  162.                 | NETXP.Controls.AutoCompleteFlags.URLMRU)));
  163.             this.comboBoxEx1.ImageIndex = 3;
  164.             this.comboBoxEx1.ImageList = this.imageList1;
  165.             this.comboBoxEx1.Location = new System.Drawing.Point(24, 16);
  166.             this.comboBoxEx1.MRUHive = NETXP.Controls.MRUKeyHive.CurrentUser;
  167.             this.comboBoxEx1.MRUKey = "Software\\Microsoft\\Internet Explorer\\TypedURLs";
  168.             this.comboBoxEx1.Name = "comboBoxEx1";
  169.             this.comboBoxEx1.Size = new System.Drawing.Size(528, 21);
  170.             this.comboBoxEx1.TabIndex = 5;
  171.             this.comboBoxEx1.Text = "comboBoxEx1";
  172.             // 
  173.             // graph1
  174.             // 
  175.             this.graph1.AxisLabelFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
  176.             this.graph1.fMaxX = 1;
  177.             this.graph1.fMaxY = 1;
  178.             this.graph1.fMinX = 0;
  179.             this.graph1.fMinY = 0;
  180.             this.graph1.HeaderColor = System.Drawing.SystemColors.ActiveCaption;
  181.             this.graph1.HeaderFont = new System.Drawing.Font("Arial", 16F);
  182.             this.graph1.Is3D = false;
  183.             this.graph1.LineColor = System.Drawing.Color.Empty;
  184.             this.graph1.LOBF = false;
  185.             this.graph1.LOBFColor = System.Drawing.Color.Empty;
  186.             this.graph1.Location = new System.Drawing.Point(24, 112);
  187.             this.graph1.Name = "graph1";
  188.             this.graph1.Size = new System.Drawing.Size(352, 280);
  189.             this.graph1.TabIndex = 6;
  190.             this.graph1.Text = "graph1";
  191.             this.graph1.XAxisColor = System.Drawing.SystemColors.ControlText;
  192.             this.graph1.XAxisLabel = "X axis";
  193.             this.graph1.YAxisColor = System.Drawing.SystemColors.ControlText;
  194.             this.graph1.YAxisLabel = "Y axis";
  195.             // 
  196.             // maskedTextBox1
  197.             // 
  198.             this.maskedTextBox1.Location = new System.Drawing.Point(400, 168);
  199.             this.maskedTextBox1.Masked = NETXP.Controls.Mask.IpAddress;
  200.             this.maskedTextBox1.Name = "maskedTextBox1";
  201.             this.maskedTextBox1.Size = new System.Drawing.Size(144, 20);
  202.             this.maskedTextBox1.TabIndex = 7;
  203.             this.maskedTextBox1.Text = "";
  204.             // 
  205.             // skinnedPanel1
  206.             // 
  207.             this.skinnedPanel1.BackColor = System.Drawing.Color.Transparent;
  208.             this.skinnedPanel1.Controls.Add(this.xpGroupBox1);
  209.             this.skinnedPanel1.Location = new System.Drawing.Point(392, 264);
  210.             this.skinnedPanel1.Name = "skinnedPanel1";
  211.             this.skinnedPanel1.Size = new System.Drawing.Size(160, 136);
  212.             this.skinnedPanel1.TabIndex = 8;
  213.             this.skinnedPanel1.Text = "skinnedPanel1";
  214.             // 
  215.             // xpGroupBox1
  216.             // 
  217.             this.xpGroupBox1.BackColor = System.Drawing.SystemColors.Control;
  218.             this.xpGroupBox1.Controls.Add(this.xpCheckBox1);
  219.             this.xpGroupBox1.Location = new System.Drawing.Point(32, 16);
  220.             this.xpGroupBox1.Name = "xpGroupBox1";
  221.             this.xpGroupBox1.Size = new System.Drawing.Size(120, 112);
  222.             this.xpGroupBox1.TabIndex = 0;
  223.             this.xpGroupBox1.TabStop = false;
  224.             this.xpGroupBox1.Text = "xpGroupBox1";
  225.             // 
  226.             // xpCheckBox1
  227.             // 
  228.             this.xpCheckBox1.BackColor = System.Drawing.Color.Transparent;
  229.             this.xpCheckBox1.Location = new System.Drawing.Point(16, 32);
  230.             this.xpCheckBox1.Name = "xpCheckBox1";
  231.             this.xpCheckBox1.TabIndex = 0;
  232.             this.xpCheckBox1.Text = "xpCheckBox1";
  233.             // 
  234.             // xpButton3
  235.             // 
  236.             this.xpButton3.Location = new System.Drawing.Point(408, 200);
  237.             this.xpButton3.Name = "xpButton3";
  238.             this.xpButton3.Size = new System.Drawing.Size(128, 23);
  239.             this.xpButton3.TabIndex = 1;
  240.             this.xpButton3.Text = "Test &About Box";
  241.             this.xpButton3.Click += new System.EventHandler(this.xpButton3_Click);
  242.             // 
  243.             // xpButton4
  244.             // 
  245.             this.xpButton4.Location = new System.Drawing.Point(408, 232);
  246.             this.xpButton4.Name = "xpButton4";
  247.             this.xpButton4.Size = new System.Drawing.Size(128, 23);
  248.             this.xpButton4.TabIndex = 9;
  249.             this.xpButton4.Text = "Test &Wizard";
  250.             this.xpButton4.Click += new System.EventHandler(this.xpButton4_Click);
  251.             // 
  252.             // Form1
  253.             // 
  254.             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  255.             this.ClientSize = new System.Drawing.Size(576, 414);
  256.             this.Controls.Add(this.xpButton4);
  257.             this.Controls.Add(this.skinnedPanel1);
  258.             this.Controls.Add(this.maskedTextBox1);
  259.             this.Controls.Add(this.graph1);
  260.             this.Controls.Add(this.comboBoxEx1);
  261.             this.Controls.Add(this.autoTextBox1);
  262.             this.Controls.Add(this.colorButton1);
  263.             this.Controls.Add(this.dropDownTreeView1);
  264.             this.Controls.Add(this.xpButton2);
  265.             this.Controls.Add(this.xpButton1);
  266.             this.Controls.Add(this.xpButton3);
  267.             this.Name = "Form1";
  268.             this.Text = "Form1";
  269.             this.skinnedPanel1.ResumeLayout(false);
  270.             this.xpGroupBox1.ResumeLayout(false);
  271.             this.ResumeLayout(false);
  272.  
  273.         }
  274.         #endregion
  275.  
  276.         /// <summary>
  277.         /// The main entry point for the application.
  278.         /// </summary>
  279.         [STAThread]
  280.         static void Main() 
  281.         {
  282.             Application.Run(new Form1());
  283.         }
  284.  
  285.         private void xpButton1_Click(object sender, System.EventArgs e)
  286.         {
  287.             NETXP.Controls.BalloonHelp bh;
  288.             bh = new NETXP.Controls.BalloonHelp();
  289.             bh.CloseOnMouseClick = true;
  290.             bh.CloseOnDeactivate = true;
  291.             bh.CloseOnKeyPress = true;
  292.             bh.Caption = "Test";
  293.             bh.Content = "Something to think about";
  294.             bh.ShowBalloon(this.xpButton1);
  295.         }
  296.  
  297.         private void xpButton2_Click(object sender, System.EventArgs e)
  298.         {
  299.             NETXP.Controls.DesktopAlert alrt;
  300.             alrt = new NETXP.Controls.DesktopAlert("test", "aaaa", "akjb");
  301.             alrt.Show();
  302.         }
  303.  
  304.         private void xpButton3_Click(object sender, System.EventArgs e)
  305.         {
  306.             AboutBox b = new AboutBox();
  307.             b.ShowDialog(this);
  308.         }
  309.  
  310.         private void xpButton4_Click(object sender, System.EventArgs e)
  311.         {
  312.             WizardTest t = new WizardTest();
  313.             t.ShowDialog(this);
  314.         }
  315.     }
  316. }
  317.