home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / netxp / netxp.exe / Samples / CS / Bars / MdiChild.cs < prev    next >
Encoding:
Text File  |  2004-03-16  |  2.1 KB  |  84 lines

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using NETXP.Controls.Bars;
  7.  
  8. namespace Bars
  9. {
  10.     /// <summary>
  11.     /// Summary description for MdiChild.
  12.     /// </summary>
  13.     public class MdiChild : System.Windows.Forms.Form
  14.     {
  15.         private System.Windows.Forms.Button button1;
  16.  
  17.         private NETXP.Controls.Bars.CommandBarManager manager;
  18.  
  19.         public MdiChild()
  20.         {
  21.             //
  22.             // Required for Windows Form Designer support
  23.             //
  24.             InitializeComponent();
  25.  
  26.             //
  27.             // TODO: Add any constructor code after InitializeComponent call
  28.             //
  29.         }
  30.  
  31.         public void SetManager(NETXP.Controls.Bars.CommandBarManager manager)
  32.         {
  33.             this.manager = manager;
  34.         }
  35.  
  36.         /// <summary>
  37.         /// Clean up any resources being used.
  38.         /// </summary>
  39.         protected override void Dispose( bool disposing )
  40.         {
  41.             base.Dispose( disposing );
  42.         }
  43.  
  44.         #region Windows Form Designer generated code
  45.         /// <summary>
  46.         /// Required method for Designer support - do not modify
  47.         /// the contents of this method with the code editor.
  48.         /// </summary>
  49.         private void InitializeComponent()
  50.         {
  51.             this.button1 = new System.Windows.Forms.Button();
  52.             this.SuspendLayout();
  53.             // 
  54.             // button1
  55.             // 
  56.             this.button1.Location = new System.Drawing.Point(24, 16);
  57.             this.button1.Name = "button1";
  58.             this.button1.Size = new System.Drawing.Size(176, 48);
  59.             this.button1.TabIndex = 1;
  60.             this.button1.Text = "Test Popup Window";
  61.             this.button1.Click += new System.EventHandler(this.button1_Click);
  62.             // 
  63.             // MdiChild
  64.             // 
  65.             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  66.             this.ClientSize = new System.Drawing.Size(344, 230);
  67.             this.Controls.Add(this.button1);
  68.             this.Name = "MdiChild";
  69.             this.Text = "MdiChild";
  70.             this.ResumeLayout(false);
  71.  
  72.         }
  73.         #endregion
  74.  
  75.         private void button1_Click(object sender, System.EventArgs e)
  76.         {
  77.             TestPopup frm;
  78.             frm = new TestPopup();
  79.             frm.SetManager(this.manager);
  80.             frm.ShowPopup(this.MdiParent, button1.PointToScreen(new Point(0, button1.Height)), false);
  81.         }
  82.     }
  83. }
  84.