Show() public method

public Show ( ) : void
return void
Example #1
0
 /// <summary>
 /// 添加界面
 /// </summary>
 /// <param name="control"></param>
 public void AddControl(string title, WinForms.Control control)
 {
     if (control == null)
     {
         MessageBox.Show("没有配置该插件", "提示");
     }
     else
     {
         if (control is WinForms.Form)
         {
             WinForms.Form frm = control as WinForms.Form;
             if (frm.TopLevel)
             {
                 frm.Show();
                 return;
             }
         }
         //
         WindowsFormsHost formsHost = new WindowsFormsHost
         {
             Child = control
         };
         TabItem item = new TabItem()
         {
             Content = formsHost,
             Header  = title
         };
         control.Show();
         grdTab.Items.Add(item);
         grdTab.SelectedItem = item;
     }
 }
Example #2
0
        // Set current page
        private void SetCurrentPage(int n)
        {
            OnPageChanging(n);

            // hide previous page
            if (currentControl != null)
            {
                currentControl.Hide();
            }

            //
            currentPage = n;

            // update dialog text
            //this.Text = title + " - Page " + ((int)(n + 1)).ToString() + " of " + panel主体.Controls.Count.ToString();

            // show new page
            currentControl = panel主体.Controls[currentPage];
            IWizardPage page = (IWizardPage)currentControl;

            currentControl.Show();

            // description
            lb介绍.Text = page.PageDescription;

            // notify the page
            page.Display();

            // update conrol buttons
            UpdateControlButtons();
        }
Example #3
0
        public void SeriesChangesWhenFunctionBindingListChanges()
        {
            IFunction function = new Function();
            IVariable yVariable = new Variable<double>("y");
            IVariable xVariable = new Variable<double>("x");
            function.Arguments.Add(xVariable);
            function.Components.Add(yVariable);
            
            function[1.0] = 2.0;
            function[2.0] = 5.0;
            function[3.0] = 1.0;

            ILineChartSeries ls = ChartSeriesFactory.CreateLineSeries();
            ls.YValuesDataMember = function.Components[0].DisplayName;
            ls.XValuesDataMember = function.Arguments[0].DisplayName;

            var synchronizeObject = new Control();
            synchronizeObject.Show();

            var functionBindingList = new FunctionBindingList(function) { SynchronizeInvoke = synchronizeObject };
            ls.DataSource = functionBindingList;
            
            //a change in the function should change the series
            function[1.0] = 20.0;

            while(functionBindingList.IsProcessing)
            {
                Application.DoEvents();
            }
            
            Assert.AreEqual(20, ls.YValues[0]);
            
        }
        /// <summary>
        /// 添加界面
        /// </summary>
        /// <param name="control"></param>
        internal void AddControl(string title, WinForms.Control control)
        {
            if (control == null)
            {
                MessageBox.Show("没有配置该插件", "提示");
            }
            else
            {
                if (control is WinForms.Form)
                {
                    WinForms.Form frm = control as WinForms.Form;
                    if (frm.TopLevel)
                    {
                        frm.Show();
                        return;
                    }
                }
                //
                WindowsFormsHost formsHost = new WindowsFormsHost
                {
                    Child = control
                };

                control.Show();
                var panel = new DocumentPanel()
                {
                    Content = formsHost, Caption = title
                };
                documentGroup.Items.Add(panel);
                documentGroup.SelectedTabIndex = documentGroup.Items.Count;
            }
        }
Example #5
0
 private void Show(System.Windows.Forms.Control f)
 {
     ReportViewer.Dock = System.Windows.Forms.DockStyle.Fill;
     ReportViewer.ShowGroupTreeButton = false;
     ReportViewer.DisplayGroupTree    = false;
     f.Controls.Clear();
     f.Controls.Add(ReportViewer);
     f.Show();
 }
Example #6
0
 private static void Shows(Control frm)
 {
     //frm.BeginInvoke((MethodInvoker)delegate {
         frm.Show();
         load.Show();
   //  });
     
   
 }
 // ADD CONTROL TO GIVEN TAB PAGE
 public void AddToPage(Control control, int tab)
 {
     control.Parent = mainView.tabPanels.TabPages[tab];
     mainView.tabPanels.SuspendLayout();
     mainView.tabPanels.TabPages[tab].Controls.Add(control);
     mainView.tabPanels.ResumeLayout();
     control.Show();
     control.Dock = DockStyle.Fill;
     mainView.Refresh();
 }
        public static void EnsureControlDisplaysCorrectlyByAddingItToAHiddenForm(Form hidden, Control controlUnderTest)
        {
            AddToParent(hidden, controlUnderTest);

            hidden.ShowInTaskbar = false;
            hidden.AllowTransparency = true;
            hidden.Opacity = 0;

            hidden.Show();
            controlUnderTest.Show();
        }
        public static void ConfigureInnerDisplay(Form hidden, Control controlUnderTest)
        {
            AddToParent(hidden, controlUnderTest);

            hidden.ShowInTaskbar = false;
            hidden.AllowTransparency = true;
            hidden.Opacity = 0;

            hidden.Show();
            controlUnderTest.Show();
        }
Example #10
0
        public static void showControl(System.Windows.Forms.Control control, System.Windows.Forms.Control Content)
        {
            Content.Controls.Clear();

            control.Show();
            control.Dock = DockStyle.Fill;
            control.BringToFront();
            control.Focus();

            Content.Controls.Add(control);
        }
Example #11
0
 public void CargarControl(Control oControl)
 {
     if (!this.panelContenedor.Controls.Contains(oControl))
     {
         oControl.Dock = DockStyle.Fill;
         this.panelContenedor.Controls.Add(oControl);
     }
     this.panelContenedor.Tag = oControl;
     oControl.BringToFront();
     oControl.Show();
 }
Example #12
0
 public static Control Show(Control parent) {
     Control o = new Control();
     o.Location = Point.Empty;
     o.Size = parent.ClientSize;
     o.Parent = parent;
     o.BackgroundImage = Resources.ExpirationHS;
     o.BackgroundImageLayout = ImageLayout.Center;
     o.BackColor = Color.WhiteSmoke;
     o.Show();
     o.BringToFront();
     return o;
 }
Example #13
0
        public void Init(int width, int height)
        {
            _ViewForm = new ViewForm();

            InputState.Init(_ViewForm);
            Sound.Init(_ViewForm);
            Graphics.Init(_ViewForm, width, height);

            _ViewForm.Show();

            _Running = true;
            _Timer = new Timer();
        }
Example #14
0
 /// <summary>
 /// Show or Hide control
 /// </summary>
 /// <param name="control1"></param>
 public void random1(Control control1)
 {
     if (brandom1==true)
     {
         control1.Show();
         brandom1 = false;
     }
     else
     {
         control1.Hide();
         brandom1 = true;
     }
 }
Example #15
0
        /// <summary>
        /// 添加界面
        /// </summary>
        /// <param name="control"></param>
        public void AddControl(string title, WinForms.Control control, string imageSource)
        {
            if (control is WinForms.Form)
            {
                WinForms.Form frm = control as WinForms.Form;
                if (frm.TopLevel)
                {
                    frm.Show();
                    return;
                }
                frm.Opacity         = this.Opacity;
                frm.ShowInTaskbar   = false;
                frm.FormBorderStyle = WinForms.FormBorderStyle.None;
            }
            Grid grid = new Grid();

            grid.Children.Add(new Label()
            {
                Content = "正在显示WinForm"
            });
            TabItem item = new TabItem
            {
                Content = grid,
                Header  = title
            };

            item.Height = 83;
            item.Width  = 74;
            Thickness cur = new Thickness(tab.Items.Count * 74 + 5, 0, 0, 0);

            item.Margin = cur;
            Style myStyle = (Style)this.FindResource("TabItemStyle");//TabItemStyle 这个样式是引用的资源文件中的样式名称

            item.Style = myStyle;
            if (!string.IsNullOrEmpty(imageSource))
            {
                ImageBrush imageBrush = new ImageBrush(new BitmapImage(new Uri(imageSource, UriKind.Relative)));
                item.Background = imageBrush;
            }
            else
            {
                ImageBrush imageBrush = new ImageBrush(new BitmapImage(new Uri("skin/ico/ico_PluginCleaner.png", UriKind.Relative)));
                item.Background = imageBrush;
            }
            control.Show();
            WinOverlayWF wF = new WinOverlayWF(grid, this);

            wF.WinBrowser.Controls.Add(control);
            tab.Items.Add(item);
            dic[item] = wF;
        }
Example #16
0
        public MainFrame(Robot R)
        {
            m_Robot = R;

              InitializeComponent();

              DeviceList L = Manager.GetDevices(DeviceType.Joystick, EnumDevicesFlags.AllDevices);
              L.MoveNext();
              if (L.Current == null)
              {
            JoystickControl.Enabled = false;
              }
              else
              {
            DeviceInstance DevInstance = (DeviceInstance)L.Current;

            m_JoystickDevice = new Device(DevInstance.InstanceGuid);
            m_JoystickDevice.SetCooperativeLevel(this, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Background);

            foreach (DeviceObjectInstance doi in m_JoystickDevice.Objects)
            {
              if ((doi.ObjectId & (int)DeviceObjectTypeFlags.Axis) != 0)
            m_JoystickDevice.Properties.SetRange(ParameterHow.ById, doi.ObjectId, new InputRange(-2550, 2550));
            }

            m_JoystickDevice.Properties.AxisModeAbsolute = true;
              }

              UpdateFields();

              FastRefreshTimer.Enabled = true;

              //m_ImageViewer = new ImageViewer();
              //m_ImageViewer.Show();

              //m_RangeImageViewer = new RangeImageViewer(m_Robot);
              //m_RangeImageViewer.Show();

              m_Control = new Control(m_Robot);
              m_Control.Show();

              //m_SphereRecognitionView = new SphereRecognitionView(m_Robot);
              //m_SphereRecognitionView.Show();

              //m_Navigation = new Navigation(m_Robot);
              //m_Navigation.Show();
        }
Example #17
0
        private void RenderThreadStart(object param)
        {
            // TODO: OP! Initialize render log file

            ProfilerShort.Autocommit = false;

            var startParams = (StartParams)param;

            m_renderWindow = startParams.InitHandler();
#if !XB1
            var control = System.Windows.Forms.Control.FromHandle(m_renderWindow.Handle);
#endif

            m_settings = MyRenderProxy.CreateDevice(this, m_renderWindow.Handle, startParams.SettingsToTry);
            if (m_settings.AdapterOrdinal == -1)
            {
                return;
            }
            MyRenderProxy.SendCreatedDeviceSettings(m_settings);
            m_currentQuality = startParams.RenderQuality;
#if !XB1
            m_form = control;
#else
            m_form = m_renderWindow as RenderForm;
#endif

            LoadContent();
            UpdateSize();

            //RenderLoop.UseCustomDoEvents = true;
            //RenderLoop.Run(m_form, RenderCallback);

            m_form.Show();
            while (m_form.Visible)
            {
                Application.DoEvents();
                if (m_form.Visible)
                {
                    RenderCallback();
                }
            }

            UnloadContent();

            MyRenderProxy.DisposeDevice();
        }
        private static void ShowTopLevelControl(Control control,bool modal)
        {
            bool wasShown = false;
            control.VisibleChanged += delegate
                                          {
                                              if (control.Visible)
                                              {
                                                  wasShown = true;
                                              }

                                              try
                                              {
                                                  if (formShown != null)
                                                  {
                                                      formShown(control is Form ? (Form)control : form);
                                                  }
                                              }
                                              catch (Exception e)
                                              {
                                                  exception = e;

                                              }

                                          };
            control.Show();

            if (IsBuildServer)
            {
                Application.DoEvents();

                if (exception != null)
                {
                    throw exception;
                }
            }
            else while (modal && control.Visible)
            {
                Application.DoEvents();

                if (exception != null)
                {
                    throw exception;
                }
            }

            while (!wasShown && !control.Visible) // wait until control is shown
            {
                Application.DoEvents();
            }
        }
Example #19
0
        private void InitializeAndShowStep(Control wizardstep)
        {
            wizardstep.SetBounds(0, 0, pnlMain.Width, pnlMain.Height);
            HideAllSteps();
            btnNext.Text = "&Next";

            switch (wizardstep.Name)
            {
                case "pnlStep_PivotalLogin":
                    {
                        break;
                    }
                case "pnlStep_PivotalDetails":
                    {
                        PopulatePivotalIterationsCombo();
                        PopulatePivotalProjectsCombo();
                        break;
                    }
                case "pnlStep_TFSLogins":
                    {
                        break;
                    }
                case "pnlStep_TFSDetails":
                    {
                        PopulateTfsIterationsCombo(cboTFSProjects.SelectedText);
                        break;
                    }
                case "pnlStep_Summary":
                    {
                        btnNext.Text = "&Finish";
                        break;
                    }
            }
            wizardstep.Show();
        }
Example #20
0
    /// <summary>
    /// Force un contrôle et tous ses conteneurs à être visibles, puis sélectionne le contrôle.
    /// </summary>
    /// <remarks>
    /// Cette méthode prend en charge tous les classeurs à onglets qui sont les conteneurs
    /// directs ou indirects du contrôle de manière à forcer la sélection de la page concernée
    /// au sein de chaque classeur à onglets.
    /// </remarks>
    /// <param name="control">contrôle à rendre effectivement visible et sélectionné</param>
    public static void ForceShowAndSelect( Control control ) {

      // contrôle de l'argument : ignorer si null
      if ( control == null ) return;

      // remontée récursive frontale jusqu'au conteneur top-level
      Control parent = control.Parent;
      if ( parent != null ) ForceShowAndSelect( parent );

      // descente de la récursion : traiter le cas des pages des classeurs à onglets
      TabPage controlAsTabPage = control as TabPage;
      TabControl parentAsTabControl = parent as TabControl;

      // le contrôle n'est pas une page, ou n'est pas hébergé par un classeur à onglets
      if ( controlAsTabPage == null || parentAsTabControl == null ) {
        control.Show();
        control.Select();
        return;
      }

      // le contrôle est une page hébergée par un classeur à onglets : sélectionner la page
      parentAsTabControl.SelectedTab = controlAsTabPage;
      control.Select();
    }
Example #21
0
        /// <summary>
        /// Runs the specified main loop for the specified windows form.
        /// </summary>
        /// <param name="form">The form.</param>
        /// <param name="renderCallback">The rendering callback.</param>
        /// <param name="useApplicationDoEvents">if set to <c>true</c> indicating whether the render loop should use the default <see cref="Application.DoEvents"/> instead of a custom window message loop lightweight for GC. Default is false.</param>
        /// <exception cref="System.ArgumentNullException">form
        /// or
        /// renderCallback</exception>
        public static void Run(Control form, RenderCallback renderCallback, bool useApplicationDoEvents = false)
        {
            if(form == null) throw new ArgumentNullException("form");
            if(renderCallback == null) throw new ArgumentNullException("renderCallback");

            form.Show();
            using (var renderLoop = new RenderLoop(form) { UseApplicationDoEvents = useApplicationDoEvents })
            {
                while(renderLoop.NextFrame())
                {
                    renderCallback();
                }
            }
        }
Example #22
0
        //override
        protected override void ColumnStartedEditing(Control editingControl)
        {
            //isEditing=true;
            #if DEBUG && TRACE
            Helper.Trace( "ColumnStartedEditing(...)","CanFocus="+editingControl.CanFocus, "editingControl.Visible=" + editingControl.Visible);
            #endif
            //base.ColumnStartedEditing(editingControl);
            if (editingControl!=null)
            {
                editingControl.Visible=true;
                editingControl.Show();

                if (editingControl.CanFocus)
                    editingControl.Focus();
            }
        }
Example #23
0
 private void ZamienMiejscami(Control first, Control second)
 {
     if (first.Visible)
     {
         first.Hide();
         second.Show();
         second.Location = first.Location;
     }
     else
     {
         second.Hide();
         first.Show();
         first.Location = second.Location;
     }
 }
Example #24
0
 /// <summary>
 /// Hides a control
 /// </summary>
 /// <param name="container">The control to hide</param>
 /// <param name="val">True to hide, false to show</param>
 public static void SafeHide(Control container, bool val)
 {
     if (container.InvokeRequired)
       {
     SafeHideCallback d = SafeHide;
     try
     {
       container.Invoke(d, new object[] { container, val });
     }
     catch (Exception) { }
       }
       else
       {
     if (val)
       container.Hide();
     else
       container.Show();
       }
 }
Example #25
0
		protected virtual void ShowControl(Control editorControl)
		{
			editorControl.Show();
			editorControl.BringToFront();
			editorControl.Focus();
		}
Example #26
0
        // Set current page
        private void SetCurrentPage(int n)
        {
            OnPageChanging(n);

            // hide previous page
            if (currentControl != null)
            {
                currentControl.Hide();
            }

            //
            currentPage = n;

            // update dialog text
            this.Text = "�豸���þ���" + " - ҳ " + ((int)(n + 1)).ToString() + " / " + workPanel.Controls.Count.ToString();

            // show new page
            currentControl = workPanel.Controls[currentPage];
            IWizardPage	page = (IWizardPage) currentControl;

            currentControl.Show();

            // description
            descriptionLabel.Text = page.PageDescription;

            // notify the page
            page.Display();
            if (n > 0)
            {
                if (page.ControlWidth > 0)
                {
                    workPanel.Width = page.ControlWidth;
                    workPanel.Height = page.ControlHeight;
                    this.Height = controlPanel.Height + workPanel.Height + descPannel.Height;
                    this.Width =  workPanel.Width;
                }

            }

            // update conrol buttons
            UpdateControlButtons();
        }
Example #27
0
        private void UpdateEventsOnControls(Control ctl)
        {
            // Console.WriteLine("Hook " + ctl.ToString() + " " + ctl.Name);
            ctl.MouseEnter -= MouseEnterControl;
            ctl.MouseLeave -= MouseLeaveControl;
            ctl.MouseEnter += MouseEnterControl;
            ctl.MouseLeave += MouseLeaveControl;

            if (ctl is DrawnPanel)
            {
                if (((DrawnPanel)ctl).ImageText != null )
                {
                    ctl.Click += EDSM_Click;
                }
            }
            else
            {
                ctl.MouseDown -= MouseDownOnForm;
                ctl.MouseDown += MouseDownOnForm;
                //Console.WriteLine("Hook Mouse down " + ctl.ToString() + " " + ctl.Name);
            }

            if ( ctl.Visible )
                ctl.Show();

            foreach (Control ctll in ctl.Controls)
            {
                UpdateEventsOnControls(ctll);
            }
        }
        private void ShowTopLevelControl(Control control, bool modal)
        {
            control.Paint += delegate { wasShown = true; };
            control.VisibleChanged += delegate { wasShown = true; };

            control.Show();

            WaitOrExit(control, modal);
        }
        /// <summary>
        /// Shows a control centered in the ServerControl window
        /// </summary>
        /// <param name="c">The control to show</param>
        private void ShowCentered(Control c)
        {
            // get sizes
            Size szUs = Size;
            Size szC = c.Size;

            // calculate position
            int x = (szUs.Width - szC.Width)/2;
            int y = (szUs.Height - szC.Height)/2;

            if (x < 0)
                x = 0;
            if (y < 0)
                y = 0;

            // set, add and show
            controlShown = c;
            Controls.Add(c);
            c.Location = new Point(x, y);
            c.Show();
            ActiveControl = c;
        }
Example #30
0
 private void changeControlShow(Control control, bool show)
 {
     if (control.InvokeRequired)
     {
         control.Invoke(controlChange, control, show);
     }
     else
     {
         if (show) control.Show();
         else control.Hide();
     }
 }
Example #31
0
        private void ShowFakeControl(Control control)
        {
            if (m_listViewSubItem != null)                  // Check if an actual item was clicked
            {
                var ClickedItem = m_listViewSubItem.Bounds; // Get the bounds of the item clicked

                // Adjust the top and left of the control
                ClickedItem.X += listView1.Left;
                ClickedItem.Y += listView1.Top;

                control.Bounds = ClickedItem;               // Set Control bounds to match calculation

                control.Text = m_listViewSubItem.Text;      // Set the default text for the Control to be the clicked item's text

                control.Show();                             // Show the Control
                control.BringToFront();                     // Make sure it is on top
                control.Focus();                            // Give focus to the Control
            }
        }
Example #32
0
        protected virtual void HandleShowingTabPage(TabPage page, Control c)
        {
            // First time this page has been displayed?
            if (!page.Shown)
            {
                // Special testing needed for Forms
                Form f = c as Form;

                // AutoScaling can cause the Control/Form to be
                if ((f != null) && (f.AutoScale))
                {
                    // Workaround the problem where a form has a defined 'AutoScaleBaseSize' value. The
                    // first time it is shown it calculates the size of each contained control and scales
                    // as needed. But if the contained control is Dock=DockStyle.Fill it scales up/down so
                    // its not actually filling the space! Get around by hiding and showing to force correct
                    // calculation.
                    c.Show();
                    c.Hide();
                }

                // Only need extra logic first time around
                page.Shown = true;
            }

            // Finally, show it!
            c.Show();

            // Restore focus to last know control to have it
            if (page.StartFocus != null)
                page.StartFocus.Focus();
            else
                c.Focus();
        }
Example #33
0
        public void ShowFloatPanel(Control Panel, string Title)
        {
            if (Title == "Encrypting")
            {
                BtnBack.Hide();
                AllowClose = false;
            }
            else if (Title == "Decrypting")
            {
                BtnBack.Hide();
                AllowClose = false;
            }

            LblTitle.Text = Title;
            //PnlFloat.BackgroundImage = this.BackgroundImage;
            //PnlFloat.BackgroundImageLayout = ImageLayout.Stretch;
            PnlFloat.Show();
            PnlFloat.BackColor = Color.Transparent;

            this.Controls.Add(PnlFloat);
            PnlFloat.Location = new Point(6, 40);
            PnlFloat.Size = new Size(this.Width - 12, this.Height - 46);
            PnlFloat.BringToFront();

            Panel.BackColor = Color.Transparent;
            Panel.Dock = DockStyle.Fill;
            Panel.Show();
            PnlFloatBase.Controls.Add(Panel);
        }
Example #34
0
		public void Show ()
		{
			Control c = new Control ();
			Assert.IsFalse (c.IsHandleCreated, "A1");
			c.HandleCreated += new EventHandler (HandleCreated_WriteStackTrace);
			c.Show ();
			Assert.IsFalse (c.IsHandleCreated, "A2");
		}
Example #35
0
        public void ShowPanel(Scoring_NodeTypes type)
        {
            switch (type)
            {
                //case Scoring_NodeTypes.Actors:
                //    if (_selected_control != ctl_Actor1)
                //    {
                //        if (_selected_control != null)
                //        {
                //            _selected_control.Hide();
                //        }
                //        _selected_control = ctl_Actor1;
                //        _selected_control.Show();
                //    }
                //    break;
                //case Scoring_NodeTypes.Location:
                //    if (_selected_control != ctl_Location1)
                //    {
                //        if (_selected_control != null)
                //        {
                //            _selected_control.Hide();
                //        }
                //        _selected_control = ctl_Location1;
                //        _selected_control.Show();
                //    }
                //    break;
                case Scoring_NodeTypes.Scoring_Rule:
                    if (_selected_control != ctl_ScoringRule1)
                    {
                        if (_selected_control != null)
                        {
                            _selected_control.Hide();
                        }
                        _selected_control = ctl_ScoringRule1;
                        _selected_control.Show();
                    }
                    break;
                //case Scoring_NodeTypes.Existence_Rule:
                //    if (_selected_control != ctl_ExistenceRule1)
                //    {
                //        if (_selected_control != null)
                //        {
                //            _selected_control.Hide();
                //        }
                //        _selected_control = ctl_ExistenceRule1;
                //        _selected_control.Show();
                //    }
                //    break;
                case Scoring_NodeTypes.Score:
                    if (_selected_control != ctl_Score1)
                    {
                        if (_selected_control != null)
                        {
                            _selected_control.Hide();
                        }
                        _selected_control = ctl_Score1;
                        _selected_control.Show();
                    }
                    break;

            }
        }
Example #36
0
 //add datagrid to specified control (main form or new resizable form)
 private void dataToWindow(Control toControl, DataGridView source)
 {
     toControl.Controls.Add(source);
     toControl.Show();
 }