Beispiel #1
0
   // This method ensures that the form's width is the preferred size of 300 pixels
   // or the size of the button plus 50 pixels, whichever amount is less.
   private void Form1_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
   {
      // This event is raised once at startup with the AffectedControl
      // and AffectedProperty properties on the LayoutEventArgs as null. 
      // The event provides size preferences for that case.
      if ((e.AffectedControl != null) && (e.AffectedProperty != null))
      {
         // Ensure that the affected property is the Bounds property
         // of the form.
         if (e.AffectedProperty.ToString() == "Bounds") 
         {
            // If layoutButton's width plus a padding of 50 pixels is greater than the preferred 
            // size of 300 pixels, increase the form's width.
            if ((this.layoutButton.Width + 50) > 300) 
            {
               this.Width = this.layoutButton.Width + 50;
            }
               // If not, keep the form's width at 300 pixels.
            else 
            {
               this.Width = 300;
            }

            // Center layoutButton on the form.
            this.layoutButton.Left = (this.ClientSize.Width - this.layoutButton.Width) / 2;
         }
      }
   }
Beispiel #2
0
 protected override void OnLayout(System.Windows.Forms.LayoutEventArgs levent)
 {
     if (mReadOnly)
     {
         dtsValue.Left  = 0;
         dtsValue.Width = this.Width;
     }
     else
     {
         dtsValue.Left  = chkEmpty.Right;
         dtsValue.Width = this.Width - chkEmpty.Right;
     }
     if (!this.DesignMode)
     {
         if (this.mOriginalFormat != 0)
         {
             if (chkEmpty.Checked)
             {
                 dtsValue.ForeColor    = System.Drawing.Color.AntiqueWhite;
                 dtsValue.Format       = System.Windows.Forms.DateTimePickerFormat.Custom;
                 dtsValue.CustomFormat = "////";
             }
             else
             {
                 dtsValue.Format       = this.mOriginalFormat;
                 dtsValue.CustomFormat = this.mOriginalCustomFormat;
                 dtsValue.ForeColor    = mOriginalForeColor;
             }
         }
     }
 }
 private void videoPanel_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
 {
     if (VideoWindowFeed != null && Playing)
     {
         VideoWindowFeed.SetWindowPosition(0, 0, videoPanel.Width, videoPanel.Height);
     }
 }
Beispiel #4
0
        private void DeletionPromptForm_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
        {
            if (e.AffectedControl == this && (e.AffectedProperty == "Visible" || e.AffectedProperty == "Bounds"))
            {
                this.LB_Message.Location = new System.Drawing.Point(12, 12);

                this.BN_No.Size      = new System.Drawing.Size(75, 23);
                this.BN_No.Location  = new System.Drawing.Point(this.ClientSize.Width - 12 - this.BN_No.Size.Width, this.ClientSize.Height - 12 - this.BN_No.Size.Height);
                this.BN_Yes.Size     = new System.Drawing.Size(75, 23);
                this.BN_Yes.Location = new System.Drawing.Point(this.BN_No.Location.X - 12 - this.BN_Yes.Size.Width, this.ClientSize.Height - 12 - this.BN_Yes.Size.Height);
            }
        }
Beispiel #5
0
        private void pnlButtons_Layout(
            object sender,
            System.Windows.Forms.LayoutEventArgs e)
        {
            //                Handles pnlButtons.Layout

            int width;

            width          = pnlButtons.Width / 2;
            btnAbort.Left  = 0;
            btnAbort.Width = width;
            btnClose.Left  = btnAbort.Right;
            btnClose.Width = width;
        }
Beispiel #6
0
        protected override void OnLayout(System.Windows.Forms.LayoutEventArgs levent)
        {
            if (Elements.Element.Is_Running)
            {
                base.OnLayout(levent);

                this.InputMask = (string)Librarys.Parameters.GetParaValue("MA_TTE_LIST");

                if (this.Text == string.Empty)
                {
                    this.Text = Elements.Element.sysMa_Tte;
                }
            }
        }
Beispiel #7
0
        //#region Event callbacks

        //void model_VideoAvailabilityChanged(object sender, VideoAvailabilityChangedEventArgs e)
        //{
        //	SetVideoControlProperties(e);
        //}

        //#endregion

        #region UI Events

        private void OnVideoPanelLayout(object sender, System.Windows.Forms.LayoutEventArgs e)
        {
            try
            {
                if (VideoWindowFeed != null)
                {
                    SetWindowPosition(VideoWindowFeed);
                }
            }
            catch (Exception exception)
            {
                _log.ErrorException("OnVideoPanelLayout", exception);
            }
        }
Beispiel #8
0
 private void OnApplicaionViewPanelLayout(object sender, System.Windows.Forms.LayoutEventArgs e)
 {
     //Microsoft.Lync.Model.LyncClientException
     try
     {
         if (View != null)
         {
             View.SyncRectangle();
         }
     }
     catch (Exception exp)
     {
         _log.ErrorException("OnApplicaionViewPanelLayout", exp);
     }
 }
        private void ErrorForm_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
        {
            this.SuspendLayout();

            if ((e.AffectedControl == this || e.AffectedControl == this.LB_ErrorMessage || e.AffectedControl == this.TB_Details) && (e.AffectedProperty == "Visible" || e.AffectedProperty == "Bounds"))
            {
                this.LB_ErrorMessage.Location = new System.Drawing.Point(12, 12);
                this.BN_ShowDetails.Size      = new System.Drawing.Size(75, 23);
                this.BN_OK.Size = new System.Drawing.Size(75, 23);

                if (this.TB_Details.Visible)
                {
                    this.TB_Details.Location = new System.Drawing.Point(12, this.LB_ErrorMessage.Location.Y + this.LB_ErrorMessage.Size.Height + 12);
                    this.TB_Details.Size     = new System.Drawing.Size(500, 200);

                    this.ClientSize = new System.Drawing.Size(this.LB_ErrorMessage.Location.X + this.TB_Details.Size.Width + 12, this.TB_Details.Location.Y + this.TB_Details.Size.Height + 4 + this.BN_ShowDetails.Size.Height + 12);
                }
                else
                {
                    this.ClientSize = new System.Drawing.Size(this.LB_ErrorMessage.Location.X + this.LB_ErrorMessage.Size.Width + 12, this.LB_ErrorMessage.Location.Y + this.LB_ErrorMessage.Size.Height + 12);
                }

                // Apply MIN_SIZE
                if (this.Size.Width < ErrorForm.MIN_SIZE.Width)
                {
                    this.Size = new System.Drawing.Size(ErrorForm.MIN_SIZE.Width, this.Size.Height);
                }
                if (this.Size.Height < ErrorForm.MIN_SIZE.Height)
                {
                    this.Size = new System.Drawing.Size(this.Size.Width, ErrorForm.MIN_SIZE.Height);
                }

                this.BN_ShowDetails.Location = new System.Drawing.Point(this.ClientSize.Width - 12 - this.BN_ShowDetails.Size.Width, this.ClientSize.Height - 12 - this.BN_ShowDetails.Size.Height);
                this.BN_OK.Location          = new System.Drawing.Point(this.BN_ShowDetails.Location.X - 12 - this.BN_OK.Size.Width, this.ClientSize.Height - 12 - this.BN_OK.Size.Height);
            }

            this.ResumeLayout(true);
        }
Beispiel #10
0
        protected override void OnLayout(System.Windows.Forms.LayoutEventArgs levent)
        {
            if (Controls.Count != 1)
            {
                return;
            }

            Gallery gallery = Controls[0] as Gallery;

            if (gallery == null)
            {
                return;
            }

            GalleryInformativeness informativeness = gallery.Informativeness as GalleryInformativeness;

            if (informativeness == null)
            {
                return;
            }

            Rectangle displayRectangle = DisplayRectangle;

            GalleryInformativenessLevel level = (GalleryInformativenessLevel)informativeness.Level;

            if (level == GalleryInformativenessLevel.Expanded)
            {
                gallery.Bounds = displayRectangle;
                return;
            }

            Size size = gallery.PreferredSize;

            gallery.Bounds = new Rectangle(
                new Point(displayRectangle.Left + (displayRectangle.Width - size.Width) / 2,
                          displayRectangle.Top + (displayRectangle.Height - size.Height) / 2),
                size);
        }
Beispiel #11
0
        public override bool Layout(object Container, System.Windows.Forms.LayoutEventArgs LayoutEventArgs)
        {
            System.Windows.Forms.Control Container_          = Container as System.Windows.Forms.Control;
            System.Drawing.Point         NextControlLocation = Container_.DisplayRectangle.Location;

            foreach (System.Windows.Forms.Control Control in Container_.Controls)
            {
                if (!Control.Visible)
                {
                    continue;
                }
                NextControlLocation.Offset(Control.Margin.Left, Control.Margin.Top);
                Control.Location = NextControlLocation;
                if (Control.AutoSize)
                {
                    Control.Size = Control.GetPreferredSize(Container_.DisplayRectangle.Size);
                }
                NextControlLocation.X  = Container_.DisplayRectangle.X;
                NextControlLocation.Y += Control.Height + Control.Margin.Bottom;
            }

            return(false);
        }
        private void BackupForm_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
        {
            if ((e.AffectedControl == this || e.AffectedControl == this.BN_Restore) && (e.AffectedProperty == "Visible" || e.AffectedProperty == "Bounds"))
            {
                this.BN_Cancel.Size = new System.Drawing.Size(70, 23);

                if (this.BN_Restore.Visible)
                {
                    this.BN_Restore.Size     = new System.Drawing.Size(70, 23);
                    this.BN_Restore.Location = new System.Drawing.Point(this.ClientSize.Width - 12 - this.BN_Restore.Size.Width, this.ClientSize.Height - 12 - this.BN_Restore.Size.Height);

                    this.BN_Cancel.Location = new System.Drawing.Point(this.BN_Restore.Location.X - 12 - this.BN_Cancel.Size.Width, this.ClientSize.Height - 12 - this.BN_Cancel.Size.Height);
                }
                else
                {
                    this.BN_Cancel.Location = new System.Drawing.Point(this.ClientSize.Width - 12 - this.BN_Cancel.Size.Width, this.ClientSize.Height - 12 - this.BN_Cancel.Size.Height);
                }

                if (this.BN_Delete.Visible)
                {
                    this.BN_Delete.Size     = new System.Drawing.Size(70, 23);
                    this.BN_Delete.Location = new System.Drawing.Point(12, this.ClientSize.Height - 12 - this.BN_Delete.Size.Height);
                }

                if (this.LB_NoSaveGameLoaded.Visible)
                {
                    this.LB_NoSaveGameLoaded.Location = new System.Drawing.Point(12, 12);
                    this.LB_NoSaveGameLoaded.Size     = new System.Drawing.Size(this.ClientSize.Width - 24, this.BN_Cancel.Location.Y - 12 - 6);
                }

                if (this.LV_BackupsList.Visible)
                {
                    this.LV_BackupsList.Location = new System.Drawing.Point(12, 12);
                    this.LV_BackupsList.Size     = new System.Drawing.Size(this.ClientSize.Width - 24, this.BN_Cancel.Location.Y - 12 - 6);
                }
            }
        }
        private void ProgressStatusBar_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
        {
            int pos = 0;

            foreach (ProgressStatusBarPanel myPanel in this.Panels)
            {
                if (myPanel.ProgressBarPanel)
                {
                    if (myStatusPanelProgressBar == null)
                    {
                        myStatusPanelProgressBar = myPanel;
                    }
                    break;
                }
                pos = pos + myPanel.Width;
            }

            if (myStatusPanelProgressBar != null)
            {
                if (myProgressBar == null)
                {
                    myProgressBar = new System.Windows.Forms.ProgressBar();
                    myStatusPanelProgressBar.Cambia += new EventHandler(myStatusPanelProgressBar_Cambia);
                }

                myProgressBar.Top     = 5;
                myProgressBar.Left    = pos + 3;
                myProgressBar.Width   = myStatusPanelProgressBar.Width - 6;
                myProgressBar.Height  = this.Height - 6;
                myProgressBar.Visible = myStatusPanelProgressBar.ProgressBarVisible && this.ShowPanels;
                myProgressBar.Minimum = myStatusPanelProgressBar.Min;
                myProgressBar.Maximum = myStatusPanelProgressBar.Max;
                myProgressBar.Value   = myStatusPanelProgressBar.Value;
                this.Controls.Add(myProgressBar);
            }
        }
 public virtual bool Layout(object container, System.Windows.Forms.LayoutEventArgs layoutEventArgs)
 {
 }
Beispiel #15
0
        protected override void OnLayout(System.Windows.Forms.LayoutEventArgs levent)
        {
//			Console.Write("OL");
            Draw();
            base.OnLayout(levent);
        }
Beispiel #16
0
 /// <summary>
 /// Handles the Layout event of the ExpandingPanel control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Windows.Forms.LayoutEventArgs"/> instance containing the event data.</param>
 private void ExpandingPanel_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
 {
 }
Beispiel #17
0
 private void mgDevX_SortButton_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
 {
     ResetImageBasedOnState();                           // Reset the image based on state
 }
Beispiel #18
0
 private void obj_Layout(System.Object sender, System.Windows.Forms.LayoutEventArgs e)
 {
     this.OnChanged(sender);
 }
 private void PropertyGrid1_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
 {
     throw new System.NotImplementedException();
 }
Beispiel #20
0
 protected virtual void OnLayout(System.Windows.Forms.LayoutEventArgs levent);