当前位置: 首页>>代码示例>>C#>>正文


C# MonthCalendar.BringToFront方法代码示例

本文整理汇总了C#中System.Windows.Forms.MonthCalendar.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# MonthCalendar.BringToFront方法的具体用法?C# MonthCalendar.BringToFront怎么用?C# MonthCalendar.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.MonthCalendar的用法示例。


在下文中一共展示了MonthCalendar.BringToFront方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDropDownButtonClick

 private void OnDropDownButtonClick(object sender, EventArgs e)
 {
     Parent.SuspendLayout();
     _monthCalendar = new MonthCalendar
                          {
                              Location =
                                  new Point(_dropButton.ClientRectangle.Left, _dropButton.ClientRectangle.Bottom)
                          };
     _monthCalendar.DateSelected += OnDateSelected;
     _monthCalendar.Location = new Point(_maskedTextBox.Location.X,
                                         _maskedTextBox.Location.Y + _maskedTextBox.Height);
     _monthCalendar.BringToFront();
     Parent.Controls.Add(_monthCalendar);
     Parent.ResumeLayout();
 }
开发者ID:gitter-badger,项目名称:UROCare,代码行数:15,代码来源:SHCPLDatePicker.cs

示例2: startDateText_Click

        private void startDateText_Click(object ender, EventArgs e)
        {
            date = new MonthCalendar();
            this.Controls.Add(date);
            date.DateSelected += new DateRangeEventHandler(date_DateSelected);
            date.Visible = true;
            date.Location = new Point(date.Parent.Location.X / 2, date.Parent.Location.Y / 2);

            date.BringToFront();
            //date.MinDate = new System.DateTime
        }
开发者ID:hanlonal,项目名称:CSE4982013,代码行数:11,代码来源:NewClientForm.cs

示例3: control_MouseDown

        private void control_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            ControlFactory factory = ControlFactory.Instance;
            if (e.Button == MouseButtons.Left)
            {
                Field field = factory.GetAssociatedField((Control)sender);
                if (field != null)
                {
                    control = (Control)sender;
                    if (field is DateField || field is DateTimeField)
                    {
                            if (!factory.IsPopup)
                        {
                            MonthCalendar customMonthCalendar = new MonthCalendar();
                            customMonthCalendar.DateSelected += new DateRangeEventHandler(customMonthCalendar_DateSelected);
                            customMonthCalendar.Size = new Size(226, 160);
                            int panelbottom = control.Parent.Bottom;
                            int top = control.Location.Y; int right = control.Parent.Right; int left = control.Left;
                            if (panelbottom - top > 185)//checking to see if the Datefield at the bottom of the canvas
                            {
                                if (right - left < 228)//if field is at the right most part of the canvas.
                                    customMonthCalendar.Location = new Point(right - 230, top + 25);
                                else
                                    customMonthCalendar.Location = new Point(control.Location.X - 10, top + 25);
                            }
                            else//if the datefield is very bottom of the canvas and no enough room for popup.
                                if (right - left < 228)  //if field is at the right and bottom most part of the canvas.
                                    customMonthCalendar.Location = new Point(right - 230, top - 165);
                            else
                                customMonthCalendar.Location = new Point(control.Location.X - 10, control.Top - 165);

                            try
                            {
                                control.Parent.Controls.Add(customMonthCalendar);
                                DateTime datetime ;
                                bool isdatetimeparse= DateTime.TryParse(control.Text, out datetime);
                                if (isdatetimeparse)
                                    customMonthCalendar.SetDate(datetime);
                                customMonthCalendar.Visible = true;
                                customMonthCalendar.BringToFront();
                                factory.IsPopup = true;
                            }
                            catch (Exception ex)
                            {
                            }
                        }
                    }
                }
            }
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:50,代码来源:Canvas.control.events.cs

示例4: PopupCalendar

 private void PopupCalendar(object sender, Point location)
 {
     ControlFactory factory = ControlFactory.Instance;
     if (!factory.IsPopup)
     {
         DataGridView grid = (DataGridView)control;
         MonthCalendar customMonthCalendar = new MonthCalendar();
         customMonthCalendar.DateSelected += new DateRangeEventHandler(dataGridview_customMonthCalendar_DateSelected);
         customMonthCalendar.Size = new Size(226, 160);
         int panelbottom = ((Control)sender).Parent.Bottom; int panelright = ((Control)sender).Parent.Right;
         int top = grid.GetCellDisplayRectangle(grid.SelectedCells[0].ColumnIndex, grid.SelectedCells[0].RowIndex, true).Y;
         int x = grid.GetCellDisplayRectangle(grid.SelectedCells[0].ColumnIndex, grid.SelectedCells[0].RowIndex, true).X;
         if (panelbottom - grid.Top > 165)
         {
             if(panelright-grid.Left<228)
                 customMonthCalendar.Location = new Point((grid.Location.X + x) - 226, grid.Location.Y + top + 25);
             else
                 customMonthCalendar.Location = new Point((grid.Location.X + x) - 10, grid.Location.Y + top + 25);
         }
         else
             if (panelright - grid.Left < 228)
                 customMonthCalendar.Location = new Point((grid.Location.X + x) - 226, grid.Location.Y + top + 25);
             else
             customMonthCalendar.Location = new Point((grid.Location.X + x) - 10, (grid.Location.Y + top) - 165);
         ((Control)sender).Parent.Controls.Add(customMonthCalendar);
         DateTime datetime;
         bool isdatetimeparse = DateTime.TryParse(grid.SelectedCells[0].Value.ToString(), out datetime);
         if (isdatetimeparse)
             customMonthCalendar.SetDate(datetime);
         customMonthCalendar.Visible = true;
         customMonthCalendar.BringToFront();
         factory.IsPopup = true;
     }
 }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:34,代码来源:Canvas.control.events.cs

示例5: DateText_Click

 private void DateText_Click(object sender, EventArgs e)
 {
     TextBox box = (TextBox)sender;
     currentBox = box;
     MonthCalendar date = new MonthCalendar();
     filterPanel.Controls.Add(date);
     date.DateSelected += new DateRangeEventHandler(date_DateSelected);
     date.Visible = true;
     date.Location = new Point(currentBox.Location.X, currentBox.Location.Y - 50);
     date.BringToFront();
 }
开发者ID:hanlonal,项目名称:CSE4982013,代码行数:11,代码来源:AnalyticsForm.cs


注:本文中的System.Windows.Forms.MonthCalendar.BringToFront方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。