System.Windows.Forms.Control.Show()

Here are the examples of the csharp api System.Windows.Forms.Control.Show() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

918 Examples 7

19 View Source File : Client.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : 0xthirteen

public void CreateRdpConnection(string server, string user, string domain, string preplacedword, string command, string execw, string runelevated, bool condrive, bool tover, bool nla)
        {
            keycode = new Dictionary<String, Code>();
            KeyCodes();
            runtype = runelevated;
            isdrive = condrive;
            cmd = command;
            target = server;
            execwith = execw;
            takeover = tover;
            networkauth = nla;

            void ProcessTaskThread()
            {
                var form = new Form();
                form.Opacity = 0;
                form.Visible = false;
                form.WindowState = FormWindowState.Minimized;
                form.ShowInTaskbar = false;
                form.FormBorderStyle = FormBorderStyle.None;
                form.Width = Screen.PrimaryScreen.WorkingArea.Width;
                form.Height = Screen.PrimaryScreen.WorkingArea.Height;
                form.Load += (sender, args) =>
                {
                    var rdpConnection = new AxMsRdpClient9NotSafeForScripting();
                    form.Controls.Add(rdpConnection);
                    var rdpC = rdpConnection.GetOcx() as IMsRdpClientNonScriptable5;
                    IMsRdpExtendedSettings rdpc2 = rdpConnection.GetOcx() as IMsRdpExtendedSettings;
                    rdpC.AllowPromptingForCredentials = false;
                    rdpC.AllowCredentialSaving = false;
                    rdpConnection.Server = server;
                    rdpConnection.Domain = domain;
                    rdpConnection.UserName = user;
                    rdpConnection.AdvancedSettings9.allowBackgroundInput = 1;
                    rdpConnection.AdvancedSettings9.BitmapPersistence = 0;
                    if(condrive == true)
                    {
                        rdpConnection.AdvancedSettings5.RedirectDrives = true;
                    }
                    if (preplacedword != string.Empty || user != string.Empty)
                    {
                        rdpConnection.UserName = user;
                        rdpConnection.AdvancedSettings9.ClearTextPreplacedword = preplacedword;
                    }
                    else
                    {
                        rdpc2.set_Property("RestrictedLogon", true);
                        rdpc2.set_Property("DisableCredentialsDelegation", true);
                    }
                    rdpConnection.AdvancedSettings9.EnableCredSspSupport = true;
                    if(networkauth == true)
                    {
                        rdpC.NegotiateSecurityLayer = true;
                    }
                    if (true)
                    {
                        rdpConnection.OnDisconnected += RdpConnectionOnOnDisconnected;
                        rdpConnection.OnLoginComplete += RdpConnectionOnOnLoginComplete;
                        rdpConnection.OnLogonError += RdpConnectionOnOnLogonError;
                    }
                    rdpConnection.Connect();
                    rdpConnection.Enabled = false;
                    rdpConnection.Dock = DockStyle.Fill;
                    Application.Run(form);
                };
                form.Show();
            }

            var rdpClientThread = new Thread(ProcessTaskThread) { IsBackground = true };
            rdpClientThread.SetApartmentState(ApartmentState.STA);
            rdpClientThread.Start();
            while (rdpClientThread.IsAlive)
            {
                Task.Delay(500).GetAwaiter().GetResult();
            }
        }

19 View Source File : ChartXY.cs
License : MIT License
Project Creator : a1xd

public void Show()
        {
            if (!Visible)
            {
                ChartX.Show();

                if (!Combined)
                {
                    ChartY.Show();
                }

                Visible = true;
            }
        }

19 View Source File : DirectionalityOptions.cs
License : MIT License
Project Creator : a1xd

public void Show()
        {
            if (IsHidden)
            {
                DirectionalityX.Show();
                DirectionalityY.Show();
                DirectionalityActiveValuereplacedle.Show();
                LpNorm.Show();
                Domain.Show();
                Range.Show();
                Range.Fields.LockCheckBox.Hide();
                WholeCheckBox.Show();
                ByComponentCheckBox.Show();
                DirectionalityLabel.Text = Constants.DirectionalityreplacedleOpen;
                DrawShown();
                IsHidden = false;
            }
        }

19 View Source File : ActiveValueLabel.cs
License : MIT License
Project Creator : a1xd

public void Show()
        {
            ValueLabel.Show();
        }

19 View Source File : LockableOption.cs
License : MIT License
Project Creator : a1xd

public override void Show(string Name)
        {
            Option.Show(Name);
            LockBox.Show();
        }

19 View Source File : OptionXY.cs
License : MIT License
Project Creator : a1xd

public void Show()
        {
            Fields.Show();
            Fields.LockCheckBox.Show();
            Label.Show();
            ActiveValueLabels.Show();
        }

19 View Source File : ChartXY.cs
License : MIT License
Project Creator : a1xd

public void SetSeparate()
        {
            if (Combined)
            {
                if (Visible)
                {
                    ChartY.Show();
                }

                ChartX.replacedles[0].Text = SetComponentreplacedle(Constants.XComponent);
                ChartY.replacedles[0].Text = SetComponentreplacedle(Constants.YComponent);

                Combined = false;
            }
        }

19 View Source File : Field.cs
License : MIT License
Project Creator : a1xd

public void Show()
        {
            Box.Show();
            Box.Enabled = true;
        }

19 View Source File : LUTPanelOptions.cs
License : MIT License
Project Creator : a1xd

public override void Show(string name)
        {
            PointsTextBox.Show();
            ActiveValuesTextBox.Show();
            ShouldShow = true;
        }

19 View Source File : WindowManager.cs
License : GNU General Public License v3.0
Project Creator : a4004

public static void MountWindow(Control.ControlCollection parent, Form window)
        {
            if (window.InvokeRequired)
            {
                Program.Debug("windowmgr", $"Request to mount {window.Name} into {parent.Owner.Name} requires control invokation.");
                Program.Debug("windowmgr", "Invoking the request on the UI thread.");

                window.Invoke(new Action(() => MountWindow(parent, window)));
                return;
            }

            window.TopLevel = false;
            window.Dock = DockStyle.Fill;

            parent.Add(window);
            window.Show();
            window.BringToFront();

            Program.Debug("windowmgr", $"Mounted window {window.Name} into {parent.Owner.Name}");
        }

19 View Source File : AccelOptionSet.cs
License : MIT License
Project Creator : a1xd

public void Show()
        {
            if (IsreplacedleMode)
            {
                Optionsreplacedle.Show();
            }

            ActiveValuesreplacedle.Show();
            Options.Show();
            Hidden = false;
        }

19 View Source File : AccelOptionSet.cs
License : MIT License
Project Creator : a1xd

public void Displayreplacedle()
        {
            Optionsreplacedle.Show();

            Options.Top = Optionsreplacedle.Top + Optionsreplacedle.Height + Constants.OptionVerticalSeperation;
        }

19 View Source File : AccelTypeOptions.cs
License : MIT License
Project Creator : a1xd

public void Show()
        {
            AccelDropdown.Show();
            AccelTypeActiveValue.Show();
            Layout(AccelDropdown.Bottom + Constants.OptionVerticalSeperation);
        }

19 View Source File : ApplyOptions.cs
License : MIT License
Project Creator : a1xd

public void EnableByComponentApplication()
        {
            IsWhole = false;
            ByComponentVectorXYLock.Show();
            ShowByComponentSet();
        }

19 View Source File : CheckBoxOption.cs
License : MIT License
Project Creator : a1xd

public override void Show(string Name)
        {
            CheckBox.Show();
            ShouldShow = true;
            CheckBox.Enabled = true;
            CheckBox.Name = Name;
            ActiveValueLabel.Show();
        }

19 View Source File : ComboBoxOptionsBase.cs
License : MIT License
Project Creator : a1xd

public override void Show(string labelText)
        {
            Label.Show();
            
            if (!string.IsNullOrWhiteSpace(labelText))
            {
                Label.Text = labelText;
            }

            OptionsDropdown.Show();
            ActiveValueLabel.Show();
            ShouldShow = true;
        }

19 View Source File : Option.cs
License : MIT License
Project Creator : a1xd

public void Show()
        {
            Field.Show();
            Label.Show();
            ActiveValueLabel.Show();
        }

19 View Source File : SwitchOption.cs
License : MIT License
Project Creator : a1xd

public override void Show(string name)
        {
            ShouldShow = true;

            if (!string.IsNullOrWhiteSpace(name))
            {
                Label.Text = name;
            }

            Label.Show();
            First.Show();
            Second.Show();
            ActiveValueLabel.Show();
        }

19 View Source File : TextOption.cs
License : MIT License
Project Creator : a1xd

public override void Show(string Name)
        {
            Label.Show();
            ShouldShow = true;
        }

19 View Source File : RemoveInvalidFeature.cs
License : Microsoft Public License
Project Creator : achimismaili

private void btnScopeSelected_Click(object sender, EventArgs e)
        {
            string msgString = string.Empty;
            int featurefound = 0;

            this.Hide();
            try
            {
                if (radioScopeWeb.Checked)
                {
                    scopeWindowScope = SPFeatureScope.Web;
                }
                else
                {
                    if (radioScopeSite.Checked)
                    {
                        scopeWindowScope = SPFeatureScope.Site;
                    }
                    else
                    {
                        if (radioScopeWebApp.Checked)
                        {
                            scopeWindowScope = SPFeatureScope.WebApplication;
                        }
                        else
                        {
                            if (radioScopeFarm.Checked)
                            {
                                scopeWindowScope = SPFeatureScope.Farm;
                            }
                            else
                                msgString = "Error in scope selection! Task canceled";
                            MessageBox.Show(msgString);
                            ((FrmMain)parentWindow).logTxt(DateTime.Now.ToString(FrmMain.DATETIMEFORMAT) + " - " + msgString + Environment.NewLine);

                            return;
                        }
                    }
                }
                featurefound = parentWindow.RemoveFeaturesWithinFarm(featureID, scopeWindowScope);
                if (featurefound == 0)
                {
                    msgString = "Feature not found in Scope:'" + scopeWindowScope.ToString() + "'. Do you want to try something else?";
                    if (MessageBox.Show(msgString, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        this.Show();
                    }
                    else
                    {

                    }
                }
                else
                {
                    msgString = "Success! Feature was found and deactivated " + featurefound + " times in Scope:'" + scopeWindowScope.ToString() + "'!";
                    MessageBox.Show(msgString);
                    parentWindow.logTxt(DateTime.Now.ToString(FrmMain.DATETIMEFORMAT) + " - " + msgString + Environment.NewLine);

                    SPFarm.Local.FeatureDefinitions.Remove(featureID, true);
                    parentWindow.logTxt(DateTime.Now.ToString(FrmMain.DATETIMEFORMAT) + " - FeatureDefinition was uninstalled." + Environment.NewLine);

                }
            }
            catch
            {
            }
            finally
            {
                        this.Close();
                        this.Dispose();
            }

        }

19 View Source File : RemoveInvalidFeature.cs
License : Microsoft Public License
Project Creator : achimismaili

private void btnScopeSelected_Click(object sender, EventArgs e)
        {
            string msgString = string.Empty;
            int featurefound = 0;

            this.Hide();
            try
            {
                if (radioScopeWeb.Checked)
                {
                    scopeWindowScope = SPFeatureScope.Web;
                }
                else
                {
                    if (radioScopeSite.Checked)
                    {
                        scopeWindowScope = SPFeatureScope.Site;
                    }
                    else
                    {
                        if (radioScopeWebApp.Checked)
                        {
                            scopeWindowScope = SPFeatureScope.WebApplication;
                        }
                        else
                        {
                            if (radioScopeFarm.Checked)
                            {
                                scopeWindowScope = SPFeatureScope.Farm;
                            }
                            else
                                msgString = "Error in scope selection! Task canceled";
                            MessageBox.Show(msgString);
                            ((FrmMain)parentWindow).logTxt(DateTime.Now.ToString(FrmMain.DATETIMEFORMAT) + " - " + msgString + Environment.NewLine);

                            return;
                        }
                    }
                }
                featurefound = parentWindow.removeFeaturesWithinFarm(featureID, scopeWindowScope);
                if (featurefound == 0)
                {
                    msgString = "Feature not found in Scope:'" + scopeWindowScope.ToString() + "'. Do you want to try something else?";
                    if (MessageBox.Show(msgString, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        this.Show();
                    }
                    else
                    {

                    }
                }
                else
                {
                    msgString = "Success! Feature was found and deactivated " + featurefound + " times in Scope:'" + scopeWindowScope.ToString() + "'!";
                    MessageBox.Show(msgString);
                    parentWindow.logTxt(DateTime.Now.ToString(FrmMain.DATETIMEFORMAT) + " - " + msgString + Environment.NewLine);

                    SPFarm.Local.FeatureDefinitions.Remove(featureID, true);
                    parentWindow.logTxt(DateTime.Now.ToString(FrmMain.DATETIMEFORMAT) + " - FeatureDefinition was uninstalled." + Environment.NewLine);

                }
            }
            catch
            {
            }
            finally
            {
                        this.Close();
                        this.Dispose();
            }

        }

19 View Source File : RemoveInvalidFeature.cs
License : Microsoft Public License
Project Creator : achimismaili

private void btnScopeSelected_Click(object sender, EventArgs e)
        {
            string msgString = string.Empty;
            int featurefound = 0;

            this.Hide();
            try
            {
                if (radioScopeWeb.Checked)
                {
                    scopeWindowScope = SPFeatureScope.Web;
                }
                else
                {
                    if (radioScopeSite.Checked)
                    {
                        scopeWindowScope = SPFeatureScope.Site;
                    }
                    else
                    {
                        if (radioScopeWebApp.Checked)
                        {
                            scopeWindowScope = SPFeatureScope.WebApplication;
                        }
                        else
                        {
                            if (radioScopeFarm.Checked)
                            {
                                scopeWindowScope = SPFeatureScope.Farm;
                            }
                            else
                                msgString = "Error in scope selection! Task canceled";
                            MessageBox.Show(msgString);
                            Log.Information(msgString);

                            return;
                        }
                    }
                }
                featurefound = parentWindow.RemoveFeaturesWithinFarm(featureID, scopeWindowScope);
                if (featurefound == 0)
                {
                    msgString = "Feature not found in Scope:'" + scopeWindowScope.ToString() + "'. Do you want to try something else?";
                    if (MessageBox.Show(msgString, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        this.Show();
                    }
                }
                else
                {
                    msgString = "Success! Feature was found and deactivated " + featurefound + " times in Scope:'" + scopeWindowScope.ToString() + "'!";
                    MessageBox.Show(msgString);
                    Log.Information(msgString );

                    SPFarm.Local.FeatureDefinitions.Remove(featureID, true);
                    Log.Information("FeatureDefinition was uninstalled.");

                }
            }
            catch
            {
            }
            finally
            {
                        this.Close();
                        this.Dispose();
            }

        }

19 View Source File : Dashboard.cs
License : GNU General Public License v3.0
Project Creator : AHosseinRnj

private void openApplicationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Show();
            this.WindowState = FormWindowState.Normal;
            NotifyIcon.Visible = false;
        }

19 View Source File : Dashboard.cs
License : GNU General Public License v3.0
Project Creator : AHosseinRnj

private void NotifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Show();
            this.WindowState = FormWindowState.Normal;
            NotifyIcon.Visible = false;
        }

19 View Source File : Control.cs
License : Mozilla Public License 2.0
Project Creator : ahyahy

public void Show()
        {
            M_Control.Show();
        }

19 View Source File : PDFExportProgress.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

private static void Run(Object center)
    {
      Point point = (Point)center;
      PDFExportProgress progressForm = new PDFExportProgress();
      progressForm.Location = new Point(point.X - progressForm.Width/2, point.Y - progressForm.Height/2);
      progressForm.Show();

      try
      {
        while(true)
        {
          Thread.Sleep(5);
          Application.DoEvents();
        }
      }
      catch(ThreadAbortException)
      {
        //We are asked to close the window
        progressForm.Close();
        progressForm.Dispose();
      }
    }

19 View Source File : MainForm.cs
License : MIT License
Project Creator : AlexGyver

private void InitializePlotForm()
        {
            plotForm = new Form
            {
                FormBorderStyle = FormBorderStyle.SizableToolWindow,
                ShowInTaskbar = false,
                StartPosition = FormStartPosition.Manual
            };
            this.AddOwnedForm(plotForm);
            plotForm.Bounds = new Rectangle
            {
                X = settings.GetValue("plotForm.Location.X", -100000),
                Y = settings.GetValue("plotForm.Location.Y", 100),
                Width = settings.GetValue("plotForm.Width", 600),
                Height = settings.GetValue("plotForm.Height", 400)
            };

            showPlot = new UserOption("plotMenuItem", false, plotMenuItem, settings);
            plotLocation = new UserRadioGroup("plotLocation", 0, new[] { plotWindowMenuItem, plotBottomMenuItem, plotRightMenuItem }, settings);

            showPlot.Changed += delegate (object sender, EventArgs e)
            {
                if (plotLocation.Value == 0)
                {
                    if (showPlot.Value && this.Visible)
                    {
                        plotForm.Show();
                    }
                    else
                    {
                        plotForm.Hide();
                    }
                }
                else
                {
                    splitContainer.Panel2Collapsed = !showPlot.Value;
                }

                treeView.Invalidate();
            };
            plotLocation.Changed += delegate (object sender, EventArgs e)
            {
                switch (plotLocation.Value)
                {
                    case 0:
                        splitContainer.Panel2.Controls.Clear();
                        splitContainer.Panel2Collapsed = true;
                        plotForm.Controls.Add(plotPanel);

                        if (showPlot.Value && this.Visible)
                        {
                            plotForm.Show();
                        }

                        break;

                    case 1:
                        plotForm.Controls.Clear();
                        plotForm.Hide();
                        splitContainer.Orientation = Orientation.Horizontal;
                        splitContainer.Panel2.Controls.Add(plotPanel);
                        splitContainer.Panel2Collapsed = !showPlot.Value;
                        break;

                    case 2:
                        plotForm.Controls.Clear();
                        plotForm.Hide();
                        splitContainer.Orientation = Orientation.Vertical;
                        splitContainer.Panel2.Controls.Add(plotPanel);
                        splitContainer.Panel2Collapsed = !showPlot.Value;
                        break;

                }
            };

            plotForm.FormClosing += delegate (object sender, FormClosingEventArgs e)
            {
                if (e.CloseReason == CloseReason.UserClosing)
                {
                    // just switch off the plotting when the user closes the form
                    if (plotLocation.Value == 0)
                    {
                        showPlot.Value = false;
                    }

                    e.Cancel = true;
                }
            };

            void MoveOrResizePlotForm(object sender, EventArgs e)
            {
                if (plotForm.WindowState != FormWindowState.Minimized)
                {
                    settings.SetValue("plotForm.Location.X", plotForm.Bounds.X);
                    settings.SetValue("plotForm.Location.Y", plotForm.Bounds.Y);
                    settings.SetValue("plotForm.Width", plotForm.Bounds.Width);
                    settings.SetValue("plotForm.Height", plotForm.Bounds.Height);
                }
            }
            plotForm.Move += MoveOrResizePlotForm;
            plotForm.Resize += MoveOrResizePlotForm;

            plotForm.VisibleChanged += delegate (object sender, EventArgs e)
            {
                Rectangle bounds = new Rectangle(plotForm.Location, plotForm.Size);
                Screen screen = Screen.FromRectangle(bounds);
                Rectangle intersection = Rectangle.Intersect(screen.WorkingArea, bounds);

                if (intersection.Width < Math.Min(16, bounds.Width) || intersection.Height < Math.Min(16, bounds.Height))
                {
                    plotForm.Location = new Point(screen.WorkingArea.Width / 2 - bounds.Width / 2, screen.WorkingArea.Height / 2 - bounds.Height / 2);
                }
            };

            this.VisibleChanged += delegate (object sender, EventArgs e)
            {
                if (this.Visible && showPlot.Value && plotLocation.Value == 0)
                {
                    plotForm.Show();
                }
                else
                {
                    plotForm.Hide();
                }
            };
        }

19 View Source File : MainForm.cs
License : MIT License
Project Creator : AlexGyver

private void InitializePlotForm() {
      plotForm = new Form {
        FormBorderStyle = FormBorderStyle.SizableToolWindow,
        ShowInTaskbar = false,
        StartPosition = FormStartPosition.Manual
      };
      this.AddOwnedForm(plotForm);
      plotForm.Bounds = new Rectangle {
        X = settings.GetValue("plotForm.Location.X", -100000),
        Y = settings.GetValue("plotForm.Location.Y", 100),
        Width = settings.GetValue("plotForm.Width", 600),
        Height = settings.GetValue("plotForm.Height", 400)
      };

      showPlot = new UserOption("plotMenuItem", false, plotMenuItem, settings);
      plotLocation = new UserRadioGroup("plotLocation", 0,
        new[] { plotWindowMenuItem, plotBottomMenuItem, plotRightMenuItem },
        settings);

      showPlot.Changed += delegate (object sender, EventArgs e) {
        if (plotLocation.Value == 0) {
          if (showPlot.Value && this.Visible) {
            plotForm.Show();
          } else {
            plotForm.Hide();
          }
        } else {
          splitContainer.Panel2Collapsed = !showPlot.Value;
        }
        treeView.Invalidate();
      };
      plotLocation.Changed += delegate (object sender, EventArgs e) {
        switch (plotLocation.Value) {
          case 0:
            splitContainer.Panel2.Controls.Clear();
            splitContainer.Panel2Collapsed = true;
            plotForm.Controls.Add(plotPanel);
            if (showPlot.Value && this.Visible) {
              plotForm.Show();
            }

            break;
          case 1:
            plotForm.Controls.Clear();
            plotForm.Hide();
            splitContainer.Orientation = Orientation.Horizontal;
            splitContainer.Panel2.Controls.Add(plotPanel);
            splitContainer.Panel2Collapsed = !showPlot.Value;
            break;
          case 2:
            plotForm.Controls.Clear();
            plotForm.Hide();
            splitContainer.Orientation = Orientation.Vertical;
            splitContainer.Panel2.Controls.Add(plotPanel);
            splitContainer.Panel2Collapsed = !showPlot.Value;
            break;
        }
      };

      plotForm.FormClosing += delegate (object sender, FormClosingEventArgs e) {
        if (e.CloseReason == CloseReason.UserClosing) {
          // just switch off the plotting when the user closes the form
          if (plotLocation.Value == 0) {
            showPlot.Value = false;
          }
          e.Cancel = true;
        }
      };

      EventHandler moveOrResizePlotForm = delegate (object sender, EventArgs e) {
        if (plotForm.WindowState != FormWindowState.Minimized) {
          settings.SetValue("plotForm.Location.X", plotForm.Bounds.X);
          settings.SetValue("plotForm.Location.Y", plotForm.Bounds.Y);
          settings.SetValue("plotForm.Width", plotForm.Bounds.Width);
          settings.SetValue("plotForm.Height", plotForm.Bounds.Height);
        }
      };
      plotForm.Move += moveOrResizePlotForm;
      plotForm.Resize += moveOrResizePlotForm;

      plotForm.VisibleChanged += delegate (object sender, EventArgs e) {
        Rectangle bounds = new Rectangle(plotForm.Location, plotForm.Size);
        Screen screen = Screen.FromRectangle(bounds);
        Rectangle intersection =
          Rectangle.Intersect(screen.WorkingArea, bounds);
        if (intersection.Width < Math.Min(16, bounds.Width) ||
            intersection.Height < Math.Min(16, bounds.Height)) {
          plotForm.Location = new Point(
            screen.WorkingArea.Width / 2 - bounds.Width / 2,
            screen.WorkingArea.Height / 2 - bounds.Height / 2);
        }
      };

      this.VisibleChanged += delegate (object sender, EventArgs e) {
        if (this.Visible && showPlot.Value && plotLocation.Value == 0) {
          plotForm.Show();
        } else {
          plotForm.Hide();
        }
      };
    }

19 View Source File : DownloadControl.cs
License : MIT License
Project Creator : AlturosDestinations

public void ShowDownloadDialog(AnnotationPackage package)
        {
            this.buttonDownload.Visible = !package.Downloading;
            this.progressBarDownload.Visible = package.Downloading;
            this.labelPercentage.Visible = package.Downloading;

            this.labelNotification.Text = "The package is not available locally yet. Please download it first";
            this.progressBarDownload.Value = (int)package.DownloadProgress;
            this.labelPercentage.Text = string.Empty;
            this.labelDownload.Text = string.Empty;

            this._packageToExtract = package;

            this.Show();

            Task.Run(() => this.ShowDownloadProgress(package));
        }

19 View Source File : BusyOverlay.cs
License : Apache License 2.0
Project Creator : AmpScm

public void Show()
        {
            if (_show >= 0 && _pb == null && Parent != null && !Parent.IsDisposed && Parent.Visible)
            {
                Bitmap img = (Bitmap)Resources.Busy;

                Size sz = img.Size;

                _pb = new PictureBox();
                _pb.Size = img.Size;
                _pb.BackColor = Parent.BackColor;
                _pb.Image = img;
                _parent.Controls.Add(_pb);

                UpdatePosition();
                _pb.Show();
            }
            _show++;
        }

19 View Source File : DemoForm.cs
License : MIT License
Project Creator : aniskop

public void Show(DemoPlugin plugin)
        {
            this.plugin = plugin;
            Text = plugin.Name;
            Show();
        }

19 View Source File : SnippingTool.cs
License : Apache License 2.0
Project Creator : AnkiUniversal

public static void Snip()
        {
            if (IsCapturing)
                return;

            if (Bitmap != null)
            {
                Bitmap.Dispose();
                GC.Collect();
            }
            IsCapturing = true;

            var screens = ScreenHelper.GetMonitorsInfo();
            forms = new SnippingTool[screens.Count];
            for (int i = 0; i < screens.Count; i++)
            {
                int horResolution = screens[i].HorizontalResolution;
                int verResolution = screens[i].VerticalResolution;
                int top = screens[i].MonitorArea.Top;
                int left = screens[i].MonitorArea.Left;
                var bitmap = new Bitmap(horResolution, verResolution, PixelFormat.Format32bppPArgb);
                using (var g = Graphics.FromImage(bitmap))
                {
                    g.CopyFromScreen(left, top, 0, 0, bitmap.Size);
                }
                forms[i] = new SnippingTool(bitmap, left, top, horResolution, verResolution);
                forms[i].Show();
            }
        }

19 View Source File : LinedefInfoPanel.cs
License : GNU General Public License v3.0
Project Creator : anotak

public void ShowInfo(Linedef l)
		{
			TypeHandler th;
			bool upperunpegged, lowerunpegged;
			string peggedness;
            //double starttime = General.stopwatch.Elapsed.TotalMilliseconds;
            SuspendLayout();

			// Show/hide stuff depending on format
			if(!General.Map.FormatInterface.HasActionArgs)
			{
                if (bUsingArgsAlready || bNeedSetup)
                {
                    arglbl1.Visible = false;
                    arglbl2.Visible = false;
                    arglbl3.Visible = false;
                    arglbl4.Visible = false;
                    arglbl5.Visible = false;
                    arg1.Visible = false;
                    arg2.Visible = false;
                    arg3.Visible = false;
                    arg4.Visible = false;
                    arg5.Visible = false;

                    tableLayoutPanel1.ColumnStyles[1].Width = 0f;
                    infopanel.Width = doomformatwidth;
                    bUsingArgsAlready = false;
                }
            }
			else
			{
                if (!bUsingArgsAlready || bNeedSetup)
                {
                    arglbl1.Visible = true;
                    arglbl2.Visible = true;
                    arglbl3.Visible = true;
                    arglbl4.Visible = true;
                    arglbl5.Visible = true;
                    arg1.Visible = true;
                    arg2.Visible = true;
                    arg3.Visible = true;
                    arg4.Visible = true;
                    arg5.Visible = true;

                    tableLayoutPanel1.ColumnStyles[1].Width = 37.5f;
                    infopanel.Width = hexenformatwidth;
                    bUsingArgsAlready = true;
                }
            }

			// Move panels
			frontpanel.Left = infopanel.Left + infopanel.Width + infopanel.Margin.Right + frontpanel.Margin.Left;
			backpanel.Left = frontpanel.Left + frontpanel.Width + frontpanel.Margin.Right + backpanel.Margin.Left;
			
			// Get line action information
			LinedefActionInfo act = General.Map.Config.GetLinedefActionInfo(l.Action);
			
			// Determine peggedness
			upperunpegged = l.IsFlagSet(General.Map.Config.UpperUnpeggedFlag);
			lowerunpegged = l.IsFlagSet(General.Map.Config.LowerUnpeggedFlag);
			if(upperunpegged && lowerunpegged)
				peggedness = "Upper/Lower";
			else if(upperunpegged)
				peggedness = "Upper";
			else if(lowerunpegged)
				peggedness = "Lower";
			else
				peggedness = "None";

            // Linedef info
            sb.Length = 0;
            sb.Append(" Linedef ");
            sb.Append(l.Index);
            sb.Append(" ");
            infopanel.Text = sb.ToString();
            sb.Length = 0;
            action.Text = act.ToString();
			length.Text = l.Length.ToString("0.##");
            sb.Append(l.AngleDeg.ToString());
            sb.Append("\u00B0");
            angle.Text = sb.ToString();
            sb.Length = 0;
			tag.Text = l.Tag.ToString();
			unpegged.Text = peggedness;

            if (bUsingArgsAlready)
            {
                // Arguments
                sb.Append(act.Args[0].replacedle);
                sb.Append(':');
                arglbl1.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(act.Args[1].replacedle);
                sb.Append(':');
                arglbl2.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(act.Args[2].replacedle);
                sb.Append(':');
                arglbl3.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(act.Args[3].replacedle);
                sb.Append(':');
                arglbl4.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(act.Args[4].replacedle);
                sb.Append(':');
                arglbl5.Text = sb.ToString();
                sb.Length = 0;
                arglbl1.Enabled = act.Args[0].Used;
                arglbl2.Enabled = act.Args[1].Used;
                arglbl3.Enabled = act.Args[2].Used;
                arglbl4.Enabled = act.Args[3].Used;
                arglbl5.Enabled = act.Args[4].Used;
                arg1.Enabled = act.Args[0].Used;
                arg2.Enabled = act.Args[1].Used;
                arg3.Enabled = act.Args[2].Used;
                arg4.Enabled = act.Args[3].Used;
                arg5.Enabled = act.Args[4].Used;
                th = General.Types.GetArgumentHandler(act.Args[0]);
                th.SetValue(l.Args[0]); arg1.Text = th.GetStringValue();
                th = General.Types.GetArgumentHandler(act.Args[1]);
                th.SetValue(l.Args[1]); arg2.Text = th.GetStringValue();
                th = General.Types.GetArgumentHandler(act.Args[2]);
                th.SetValue(l.Args[2]); arg3.Text = th.GetStringValue();
                th = General.Types.GetArgumentHandler(act.Args[3]);
                th.SetValue(l.Args[3]); arg4.Text = th.GetStringValue();
                th = General.Types.GetArgumentHandler(act.Args[4]);
                th.SetValue(l.Args[4]); arg5.Text = th.GetStringValue();
            }

			// Front side available?
			if(l.Front != null)
			{
                // Show sidedef info
                sb.Append(" Front Sidedef ");
                sb.Append(l.Front.Index);
                sb.Append(' ');
                frontpanel.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(" Sector ");
                sb.Append(l.Front.Sector.Index);
                frontsector.Text = sb.ToString();
                sb.Length = 0;
				frontsector.Visible = true;
                sb.Append(l.Front.OffsetX);
                sb.Append(", ");
                sb.Append(l.Front.OffsetY);
                frontoffset.Text = sb.ToString();
                sb.Length = 0;
				fronthighname.Text = l.Front.HighTexture;
				frontmidname.Text = l.Front.MiddleTexture;
				frontlowname.Text = l.Front.LowTexture;
				DisplaySidedefTexture(fronthightex, l.Front.HighTexture, l.Front.HighRequired());
				DisplaySidedefTexture(frontmidtex, l.Front.MiddleTexture, l.Front.MiddleRequired());
				DisplaySidedefTexture(frontlowtex, l.Front.LowTexture, l.Front.LowRequired());
				frontoffsetlabel.Enabled = true;
				frontoffset.Enabled = true;
				frontpanel.Enabled = true;
			}
			else
			{
                // Show no info
                frontpanel.Text = " Front Sidedef ";
                frontsector.Text = "";
                frontsector.Visible = false;
                frontoffsetlabel.Enabled = false;
                frontoffset.Enabled = false;
                frontpanel.Enabled = false;
                frontoffset.Text = "--, --";
                fronthighname.Text = "";
                frontmidname.Text = "";
                frontlowname.Text = "";
                fronthightex.BackgroundImage = null;
                frontmidtex.BackgroundImage = null;
                frontlowtex.BackgroundImage = null;
			}

			// Back size available?
			if(l.Back != null)
			{
                // Show sidedef info
                sb.Append(" Back Sidedef ");
                sb.Append(l.Back.Index);
                sb.Append(' ');
                backpanel.Text = sb.ToString();
                sb.Length = 0;

                sb.Append(" Sector ");
                sb.Append(l.Back.Sector.Index);
                backsector.Text = sb.ToString();
                sb.Length = 0;
				backsector.Visible = true;
                sb.Append(l.Back.OffsetX);
                sb.Append(", ");
                sb.Append(l.Back.OffsetY);
                backoffset.Text = sb.ToString();
                sb.Length = 0;
				backhighname.Text = l.Back.HighTexture;
				backmidname.Text = l.Back.MiddleTexture;
				backlowname.Text = l.Back.LowTexture;
				DisplaySidedefTexture(backhightex, l.Back.HighTexture, l.Back.HighRequired());
				DisplaySidedefTexture(backmidtex, l.Back.MiddleTexture, l.Back.MiddleRequired());
				DisplaySidedefTexture(backlowtex, l.Back.LowTexture, l.Back.LowRequired());
				backoffsetlabel.Enabled = true;
				backoffset.Enabled = true;
				backpanel.Enabled = true;
			}
			else
			{
                // Show no info
                backpanel.Text = " Back Sidedef ";
                backsector.Text = "";
                backsector.Visible = false;
                backoffsetlabel.Enabled = false;
                backoffset.Enabled = false;
                backpanel.Enabled = false;
                backoffset.Text = "--, --";
                backhighname.Text = "";
                backmidname.Text = "";
                backlowname.Text = "";
                backhightex.BackgroundImage = null;
                backmidtex.BackgroundImage = null;
                backlowtex.BackgroundImage = null;
			}
			
			// Position labels
			frontsector.Left = frontlowtex.Right - frontsector.Width;
			backsector.Left = backlowtex.Right - backsector.Width;
            ResumeLayout();
			// Show the whole thing
			this.Show();
            this.Invalidate();
            //this.Update(); // ano - don't think this is needed, and is slow

            bNeedSetup = false;

            //Logger.WriteLogLine((General.stopwatch.Elapsed.TotalMilliseconds - starttime) + " milliseconds for linedefinfopanel.showinfo");
        }

19 View Source File : ThingInfoPanel.cs
License : GNU General Public License v3.0
Project Creator : anotak

public void ShowInfo(Thing t)
		{
			ThingTypeInfo ti;
			LinedefActionInfo act = null;
			TypeHandler th;
			string actioninfo = "";
			string zinfo;
			float zvalue;

			// Show/hide stuff depending on format
			if(!General.Map.FormatInterface.HasActionArgs)
			{
				arglbl1.Visible = false;
				arglbl2.Visible = false;
				arglbl3.Visible = false;
				arglbl4.Visible = false;
				arglbl5.Visible = false;
				arg1.Visible = false;
				arg2.Visible = false;
				arg3.Visible = false;
				arg4.Visible = false;
				arg5.Visible = false;
				infopanel.Width = doomformatwidth;
			}
			else
			{
				arglbl1.Visible = true;
				arglbl2.Visible = true;
				arglbl3.Visible = true;
				arglbl4.Visible = true;
				arglbl5.Visible = true;
				arg1.Visible = true;
				arg2.Visible = true;
				arg3.Visible = true;
				arg4.Visible = true;
				arg5.Visible = true;
				infopanel.Width = hexenformatwidth;
			}

			// Move panel
			spritepanel.Left = infopanel.Left + infopanel.Width + infopanel.Margin.Right + spritepanel.Margin.Left;
			
			// Lookup thing info
			ti = General.Map.Data.GetThingInfo(t.Type);

			// Get thing action information
			if(General.Map.Config.LinedefActions.ContainsKey(t.Action))
			{
				act = General.Map.Config.LinedefActions[t.Action];
				actioninfo = act.ToString();
			}
			else if(t.Action == 0)
				actioninfo = t.Action.ToString() + " - None";
			else
				actioninfo = t.Action.ToString() + " - Unknown";
			
			// Determine z info to show
			t.DetermineSector();
			if(ti.AbsoluteZ)
			{
				zvalue = t.Position.z;
				zinfo = zvalue.ToString();
			}
			else
			{
				if(t.Sector != null)
				{
					// Hangs from ceiling?
					if(ti.Hangs)
					{
						zvalue = (float)t.Sector.CeilHeight + t.Position.z;
						zinfo = zvalue.ToString();
					}
					else
					{
						zvalue = (float)t.Sector.FloorHeight + t.Position.z;
						zinfo = zvalue.ToString();
					}
				}
				else
				{
					zvalue = t.Position.z;
					if(zvalue >= 0.0f) zinfo = "+" + zvalue.ToString(); else zinfo = zvalue.ToString();
				}
			}

			// Thing info
			infopanel.Text = " Thing " + t.Index + " ";
			type.Text = t.Type + " - " + ti.replacedle;
			action.Text = actioninfo;
			position.Text = t.Position.x.ToString() + ", " + t.Position.y.ToString() + ", " + zinfo;
			tag.Text = t.Tag.ToString();
			angle.Text = t.AngleDoom.ToString() + "\u00B0";
			
			// Sprite
			if(ti.Sprite.ToLowerInvariant().StartsWith(DataManager.INTERNAL_PREFIX) && (ti.Sprite.Length > DataManager.INTERNAL_PREFIX.Length))
			{
				spritename.Text = "";
				General.DisplayZoomedImage(spritetex, General.Map.Data.GetSpriteImage(ti.Sprite).GetBitmap());
			}
			else if(ti.Sprite.Length > 0)
			{
				spritename.Text = ti.Sprite;
				General.DisplayZoomedImage(spritetex, General.Map.Data.GetSpriteImage(ti.Sprite).GetPreview());
			}
			else
			{
				spritename.Text = "";
				spritetex.BackgroundImage = null;
			}
			
			// Arguments
			if(act != null)
			{
				arglbl1.Text = act.Args[0].replacedle + ":";
				arglbl2.Text = act.Args[1].replacedle + ":";
				arglbl3.Text = act.Args[2].replacedle + ":";
				arglbl4.Text = act.Args[3].replacedle + ":";
				arglbl5.Text = act.Args[4].replacedle + ":";
				arglbl1.Enabled = act.Args[0].Used;
				arglbl2.Enabled = act.Args[1].Used;
				arglbl3.Enabled = act.Args[2].Used;
				arglbl4.Enabled = act.Args[3].Used;
				arglbl5.Enabled = act.Args[4].Used;
				arg1.Enabled = act.Args[0].Used;
				arg2.Enabled = act.Args[1].Used;
				arg3.Enabled = act.Args[2].Used;
				arg4.Enabled = act.Args[3].Used;
				arg5.Enabled = act.Args[4].Used;
				th = General.Types.GetArgumentHandler(act.Args[0]);
				th.SetValue(t.Args[0]); arg1.Text = th.GetStringValue();
				th = General.Types.GetArgumentHandler(act.Args[1]);
				th.SetValue(t.Args[1]); arg2.Text = th.GetStringValue();
				th = General.Types.GetArgumentHandler(act.Args[2]);
				th.SetValue(t.Args[2]); arg3.Text = th.GetStringValue();
				th = General.Types.GetArgumentHandler(act.Args[3]);
				th.SetValue(t.Args[3]); arg4.Text = th.GetStringValue();
				th = General.Types.GetArgumentHandler(act.Args[4]);
				th.SetValue(t.Args[4]); arg5.Text = th.GetStringValue();
			}
			else
			{
				arglbl1.Text = "Argument 1:";
				arglbl2.Text = "Argument 2:";
				arglbl3.Text = "Argument 3:";
				arglbl4.Text = "Argument 4:";
				arglbl5.Text = "Argument 5:";
				arglbl1.Enabled = false;
				arglbl2.Enabled = false;
				arglbl3.Enabled = false;
				arglbl4.Enabled = false;
				arglbl5.Enabled = false;
				arg1.Enabled = false;
				arg2.Enabled = false;
				arg3.Enabled = false;
				arg4.Enabled = false;
				arg5.Enabled = false;
				arg1.Text = "-";
				arg2.Text = "-";
				arg3.Text = "-";
				arg4.Text = "-";
				arg5.Text = "-";
			}

			// Show the whole thing
			this.Show();
            //this.Update(); // ano - don't think this is needed, and is slow
        }

19 View Source File : VertexInfoPanel.cs
License : GNU General Public License v3.0
Project Creator : anotak

public void ShowInfo(Vertex v)
		{
			// Vertex info
			vertexinfo.Text = " Vertex " + v.Index + " ";
			position.Text = v.Position.x.ToString("0.##") + ", " + v.Position.y.ToString("0.##");
			
			// Show the whole thing
			this.Show();
            //this.Update(); // ano - don't think this is needed, and is slow
        }

19 View Source File : SectorInfoPanel.cs
License : GNU General Public License v3.0
Project Creator : anotak

public void ShowInfo(Sector s)
		{
			string effectinfo = "";
			
			int sheight = s.CeilHeight - s.FloorHeight;

			// Lookup effect description in config
			if(General.Map.Config.SectorEffects.ContainsKey(s.Effect))
				effectinfo = General.Map.Config.SectorEffects[s.Effect].ToString();
			else if(s.Effect == 0)
				effectinfo = s.Effect.ToString() + " - Normal";
			else
				effectinfo = s.Effect.ToString() + " - Unknown";

			// Sector info
			sectorinfo.Text = " Sector " + s.Index + " ";
			effect.Text = effectinfo;
			ceiling.Text = s.CeilHeight.ToString();
			floor.Text = s.FloorHeight.ToString();
			tag.Text = s.Tag.ToString();
			height.Text = sheight.ToString();
			brightness.Text = s.Brightness.ToString();
			floorname.Text = s.FloorTexture;
			ceilingname.Text = s.CeilTexture;
			General.DisplayZoomedImage(floortex, General.Map.Data.GetFlatImage(s.FloorTexture).GetPreview());
			General.DisplayZoomedImage(ceilingtex, General.Map.Data.GetFlatImage(s.CeilTexture).GetPreview());

			// Show the whole thing
			this.Show();
            //this.Update(); // ano - don't think this is needed, and is slow
        }

19 View Source File : MetroDropShadow.cs
License : MIT License
Project Creator : arsium

private void shadowTargetForm_ResizeEnd(object sender, EventArgs e)
		{
			Bounds = new Rectangle(shadowTargetForm.Location.X - 5, shadowTargetForm.Location.Y - 5, shadowTargetForm.Width + 10, shadowTargetForm.Height + 10);

			Visible = (shadowTargetForm.WindowState == FormWindowState.Normal);
			if (Visible)
			{
				Show();
			}
		}

19 View Source File : MetroDropShadow.cs
License : MIT License
Project Creator : arsium

private void shadowTargetForm_Activated(object sender, EventArgs e)
		{
			Bounds = new Rectangle(shadowTargetForm.Location.X - 5, shadowTargetForm.Location.Y - 5, shadowTargetForm.Width + 10, shadowTargetForm.Height + 10);

			Visible = (shadowTargetForm.WindowState == FormWindowState.Normal);
			if (Visible)
			{
				Show();
			}
		}

19 View Source File : MinerInfo.cs
License : GNU General Public License v3.0
Project Creator : arunsatyarth

public void ShowTabInfo(Form form)
        {
            form.TopLevel = false;
            pnlMinerInfo.Controls.Clear();
            pnlMinerInfo.Controls.Add(form);
            form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            form.Dock = DockStyle.Fill;
            IMinerInfoTab tab = form as IMinerInfoTab;
            if (tab != null)
                tab.UpdateUI();
            CurrentTab = tab;//its ok if its null after cast
            form.Show();
        }

19 View Source File : MainForm.cs
License : GNU General Public License v3.0
Project Creator : arunsatyarth

public void BringToView(Form next)
        {
            next.TopLevel = false;
            pnlCarousal.Controls.Clear();
            pnlCarousal.Controls.Add(next);
            next.Dock = DockStyle.Fill;
            //next.Opacity = .5;//opacity doesnt work for embedded forms
            next.Show();
            /*
            for (int i = 0; i < 10; i++)
            {
                Thread.Sleep(600);
                next.Opacity += .1;
                next.Refresh();
            }
             */
        }

19 View Source File : AddMinerContainer.cs
License : GNU General Public License v3.0
Project Creator : arunsatyarth

public void ShowStage()
        {
            Form objForm = null;
            switch (m_currentState)
            {
                case 0:
                    objForm = AddMiner;
                    break;
                case 1:

                    if (m_selected_coin != null)
                    {
                        ICoinConfigurer form = m_selected_coin.SettingsScreen;
                        form.replacedignParent(this);
                        objForm = form as Form;
                    }
                    break;
                case 2://Dual miner selection screen
                    AddDualMiner.SelectedCoin = m_selected_coin;
                    AddDualMiner.Init();
                    objForm = AddDualMiner;
                    break;
                case 3://Dual miner settings screen
                    if (m_selected_dual_coin != null)
                    {
                        ICoinConfigurer form = m_selected_dual_coin.SettingsScreen;
                        form.replacedignParent(this);
                        objForm = form as Form;
                    }
                    break;
                case 4://Finish screen
                    //m_finishScreen.SelectedCoin = m_selected_coin;
                    //m_finishScreen.SelectedDualCoin = m_selected_dual_coin;
                    m_finishScreen.UpdateUI();
                    objForm = m_finishScreen;
                    break;


            }
            if (objForm != null)
            {
                objForm.TopLevel = false;
                pnlForm.Controls.Clear();
                pnlForm.Controls.Add(objForm);
                objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                objForm.Dock = DockStyle.Fill;
                objForm.Show();
            }

        }

19 View Source File : MainForm.cs
License : GNU General Public License v3.0
Project Creator : arunsatyarth

private void showToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Show();
            WindowState = FormWindowState.Normal;
        }

19 View Source File : Notepad.cs
License : MIT License
Project Creator : ASHTeam

public void Show(String gameID)
        {
            char delim = Path.DirectorySeparatorChar;
            /*if (gameID.Length >= 3)
            {
                gId = gameID.Substring(0, 3);
            }
            else
            {
                gId = "SYSMENU";
            }*/
            Text = "Notepad";
            if (!Directory.Exists("notes"))
                Directory.CreateDirectory("notes");

            PSelected = null;
            SheetSelection.TabPages.Clear();

            List<Sheet> sheets = null;

            if (File.Exists("notes.xml"))
                try
                {
                    sheets = ImportSheet("notes.xml");
                }
                catch 
                {
                    sheets = new List<Sheet>();
                }
            else
                sheets = new List<Sheet>();
            
            if (sheets.Count==0)
                sheets.Add(new Sheet("Default sheet"));

            for (int i = 0; i < sheets.Count; i++)
            {
                CreateSheet(sheets[i]);
            }
            SheetSelection.SelectedIndex = 0;

            base.Show();
        }

19 View Source File : Document.cs
License : MIT License
Project Creator : AshV

public void open()
        {
            System.Console.WriteLine(text_);
            images_.ForEach(img =>
            {
                Form form = new Form();
                Label label = new Label();
                form.BackgroundImage = img.getImage();
                form.Show();
            });
        }

19 View Source File : Document.cs
License : MIT License
Project Creator : AshV

public void clickImage()
        {
            Form form = new Form();
            Label label = new Label();
            form.BackgroundImage = images_[0].getImage();
            form.Show();
        }

19 View Source File : WebBrowserBrowser.cs
License : Apache License 2.0
Project Creator : auth0

public async Task<BrowserResult> InvokeAsync(BrowserOptions options, CancellationToken cancellationToken = default)
        {
            using (var form = _formFactory.Invoke())
            using (var browser = new ExtendedWebBrowser()
            {
                Dock = DockStyle.Fill
            })
            {
                var signal = new SemapreplacedSlim(0, 1);

                var result = new BrowserResult
                {
                    ResultType = BrowserResultType.UserCancel
                };

                form.FormClosed += (s, e) =>
                {
                    signal.Release();
                };

                browser.NavigateError += (s, e) =>
                {
                    // Windows Server secure browsing requires this
                    if (e.Url.StartsWith(options.EndUrl))
                    {
                        e.Cancel = true;
                        result.ResultType = BrowserResultType.Success;
                        result.Response = e.Url;
                        signal.Release();
                    }
                };

                browser.DoreplacedentCompleted += (s, e) =>
                {
                    if (e.Url.AbsoluteUri.StartsWith(options.EndUrl))
                    {
                        result.ResultType = BrowserResultType.Success;
                        result.Response = e.Url.ToString();
                        signal.Release();
                    }
                };

                try
                {
                    form.Controls.Add(browser);
                    browser.Show();
                    form.Show();

                    browser.Navigate(options.StartUrl);

                    await signal.WaitAsync();
                }
                finally
                {
                    form.Hide();
                    browser.Hide();
                }

                return result;
            }
        }

19 View Source File : WebViewBrowser.cs
License : Apache License 2.0
Project Creator : auth0

public Task<BrowserResult> InvokeAsync(BrowserOptions options, CancellationToken cancellationToken = default)
        {
            var tcs = new TaskCompletionSource<BrowserResult>();

            var window = _formFactory();
            var webView = new WebViewCompatible { Dock = DockStyle.Fill };

            webView.NavigationCompleted += (sender, e) =>
            {
                if (e.Uri.AbsoluteUri.StartsWith(options.EndUrl))
                {
                    tcs.SetResult(new BrowserResult { ResultType = BrowserResultType.Success, Response = e.Uri.ToString() });
                    window.Close();
                }
            };

            window.Closing += (sender, e) =>
            {
                if (!tcs.Task.IsCompleted)
                    tcs.SetResult(new BrowserResult { ResultType = BrowserResultType.UserCancel });
            };


            window.Controls.Add(webView);
            window.Show();
            webView.Navigate(options.StartUrl);

            return tcs.Task;
        }

19 View Source File : FormBackground.cs
License : MIT License
Project Creator : AutoItConsulting

private void KeyboardHook_OnPressed(object sender, KeyPressedEventArgs e)
        {
            // Ignore if quit in progress
            if (_eventShutdownRequested.WaitOne(0))
            {
                return;
            }

            // Ignore if already showing the tools form
            if (ShowingPreplacedwordOrTools)
            {
                return;
            }

            // Ignore if there are no possible tabs enabled
            if (_userToolsEnabled == false && _taskSequenceVariablesEnabled == false)
            {
                return;
            }

            ShowingPreplacedwordOrTools = true;

            // Hide the background window because it causes issues when the user clicks on it
            if (_customBackgroundEnabled)
            {
                Activate();
                BringToFront();
                Hide();
            }

            // Hide TS dialog
            TaskSequence.CloseProgressDialog();

            // Ask for preplacedword if needed
            PreplacedwordMode preplacedwordMode;

            using (var formPreplacedword = new FormPreplacedword(_options))
            {
                formPreplacedword.ShowDialog();
                preplacedwordMode = formPreplacedword.PreplacedwordMode;
            }

            // If preplacedword is ok, launch the tools
            if (preplacedwordMode != PreplacedwordMode.None)
            {
                _formTools = new FormTools(_options, preplacedwordMode, _osdBackgroundDir);
                DialogResult result = _formTools.ShowDialog(this);
                _formTools.Dispose();
                _formTools = null;

                // Check if closed via the "Close App" button 
                if (result == DialogResult.Abort)
                {
                    // Queue the quit signal
                    _eventShutdownRequested.Set();
                }
            }

            // Reshow the background and push it to the back again
            if (_customBackgroundEnabled)
            {
                Show();
            }

            // Push the Win7/Win10 progress screen to the bottom, then put our form on top of that
            BringToFrontOfWindowsSetupProgress();

            // Reshow TS progress
            TaskSequence.ShowTsProgress();

            ShowingPreplacedwordOrTools = false;
        }

19 View Source File : AyWinformHost.cs
License : MIT License
Project Creator : ay2015

private void _placementTarget_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            var d = (bool)e.NewValue;
            if (d)
            {
                _form.Show();
            }
            else
            {
                _form.Hide();
            }
        }

19 View Source File : Main.cs
License : MIT License
Project Creator : bandaranayake

private void btnDraw_Click(object sender, EventArgs e)
        {
            if (_original == null)
            {
                MessageBox.Show("No image selected. Click 'Browse' to select an image.", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                Hide();
                Thread.Sleep(500);

                Bitmap image = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

                using (Graphics g = Graphics.FromImage(image))
                {
                    g.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, image.Size, CopyPixelOperation.SourceCopy);
                    g.DrawRectangle(Pens.Red, 1, 1, image.Width - 3, image.Height - 3);
                }

                ScreenOverlay overlay = new ScreenOverlay(image);
                Show();

                if (overlay.ShowDialog() == DialogResult.OK)
                {
                    WindowState = FormWindowState.Minimized;
                    image.Dispose();

                    CvInvoke.Resize(_img, _img, new Size(_img.Cols, _img.Rows));
                    CvInvoke.BitwiseNot(_img, _img);

                    Thread.Sleep(2000);

                    _lastPoint = new Point(-1, -1);
                    _pid = GetActiveProcess();

                    Draw(_img, overlay.Pos.X, overlay.Pos.Y);
                    WindowState = FormWindowState.Normal;
                }
            }
        }

See More Examples