Hide() public method

public Hide ( ) : void
return void
Exemplo n.º 1
1
 private static void hider(Control frm)
 {
     frm.BeginInvoke((MethodInvoker)delegate
     {
         frm.Hide();
         load.Hide();
     });
 }
Exemplo n.º 2
0
 public static void Hide(Control control)
 {
     if (control.InvokeRequired)
         control.Invoke(new ShowHideDelegate(Hide), control);
     else
         control.Hide();
 }
Exemplo n.º 3
0
 private void hideControl(Control ctrl, int time)
 {
     var T = new Timer();
     T.Interval = time * 1000;
     T.Tick += delegate { ctrl.Hide(); T.Stop(); };
     T.Start();
 }
Exemplo n.º 4
0
        public void AddPopupPanel(Control _TargetControl, Control _PopupControl,  PopupEvent _PStyle, int _width, int _height)
        {
            PopupContent popup = new PopupContent();
            popup.TargetControl = _TargetControl;
            popup.PopupControl = _PopupControl;
            popup.PType = PopupType.Panel;
            popup.PStyle = _PStyle;
            popup.WStyle = WindowStyle.Default;
            popup.Width = _width;
            popup.Height = _height;
            popup.IsMCHide = true;
            popup.WindowTitle = "";

            _PopupControl.Tag = this;

            if (popup.PStyle == PopupEvent.Click)
            {
                _TargetControl.Click += new EventHandler(_TargetControl_Click);
            }
            else if (popup.PStyle == PopupEvent.Mouse)
            {
                _TargetControl.MouseEnter += new EventHandler(_TargetControl_MouseEnter);
                _TargetControl.MouseLeave += new EventHandler(_TargetControl_MouseLeave);
            }
            else
            {

            }

            popupList.Add(popup);

            _PopupControl.Hide();
        }
 public CustomEdit(IntPtr handle, TreeListView treelistview, Control editor)
 {
     _treelistview = treelistview;
     _informations = _treelistview.EditedItem;
     if (editor == null)
     {
         _editor = new TextBox();
     }
     else
     {
         _editor = editor;
     }
     _editor.Hide();
     if (!_treelistview.Controls.Contains(_editor))
     {
         _treelistview.Controls.Add(_editor);
     }
     _editorhandle = new TreeListViewItemEditControlHandle(_treelistview, _editor, this);
     AssignHandle(handle);
 }
Exemplo n.º 6
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;
     }
 }
Exemplo n.º 7
0
        private void HandleTransitionCompleted(object sender, TransitionCompletedEventArgs<StateID, EventID, EventArgs> e)
        {
            if (e.Error != null)
            {
                MessageBox.Show(e.Error.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            switch (e.TargetStateID)
            {
                case StateID.Off:
                    currentPictureBox.Hide();
                    offPictureBox.Show();
                    currentPictureBox = offPictureBox;

                    currentUmlPictureBox.Hide();
                    umlOffPictureBox.Show();
                    currentUmlPictureBox = umlOffPictureBox;
                    break;

                case StateID.Red:
                    currentPictureBox.Hide();
                    redPictureBox.Show();
                    currentPictureBox = redPictureBox;

                    currentUmlPictureBox.Hide();
                    umlRedPictureBox.Show();
                    currentUmlPictureBox = umlRedPictureBox;
                    break;

                case StateID.Yellow:
                    currentPictureBox.Hide();
                    yellowPictureBox.Show();
                    currentPictureBox = yellowPictureBox;

                    currentUmlPictureBox.Hide();
                    umlYellowPictureBox.Show();
                    currentUmlPictureBox = umlYellowPictureBox;
                    break;

                case StateID.Green:
                    currentPictureBox.Hide();
                    greenPictureBox.Show();
                    currentPictureBox = greenPictureBox;

                    currentUmlPictureBox.Hide();
                    umlGreenPictureBox.Show();
                    currentUmlPictureBox = umlGreenPictureBox;
                    break;
            }
        }
Exemplo n.º 8
0
        // Override this method in order to access the containing user controls
        // from the default Collection Editor form or to add new ones...
        protected override CollectionForm CreateCollectionForm()
        {
            // Getting the default layout of the Collection Editor...
            CollectionForm collectionForm = base.CreateCollectionForm();

            bool allowAdd                = false;
            bool allowRemove             = false;
            Form frmCollectionEditorForm = collectionForm as Form;

            frmCollectionEditorForm.HelpButton = false;
            frmCollectionEditorForm.Text       = "Collection Editor";
            if (CollectionItemType == typeof(ReportRestriction))
            {
                frmCollectionEditorForm.Text = "Restrictions Collection Editor";
            }
            else if (CollectionItemType == typeof(OutputParameter))
            {
                frmCollectionEditorForm.Text = "Custom Output Parameters Collection Editor";
            }
            else if (CollectionItemType == typeof(SecurityParameter))
            {
                frmCollectionEditorForm.Text = "Security Parameters Collection Editor";
                _useHandlerInterface         = false;
            }
            else if (CollectionItemType == typeof(Parameter))
            {
                frmCollectionEditorForm.Text = "Template Parameters Collection Editor";
            }
            else if (CollectionItemType == typeof(SecurityGroup))
            {
                frmCollectionEditorForm.Text = "Security Groups Collection Editor";
                allowAdd             = true;
                allowRemove          = true;
                _useHandlerInterface = false;
            }
            else if (CollectionItemType == typeof(SecurityFolder))
            {
                frmCollectionEditorForm.Text = "Security Folders Collection Editor";
                allowAdd             = true;
                allowRemove          = true;
                _useHandlerInterface = false;
            }
            else if (CollectionItemType == typeof(SecurityColumn))
            {
                frmCollectionEditorForm.Text = "Security Columns Collection Editor";
                allowAdd             = true;
                allowRemove          = true;
                _useHandlerInterface = false;
            }
            else if (CollectionItemType == typeof(SecuritySource))
            {
                frmCollectionEditorForm.Text = "Security Data Sources Collection Editor";
                allowAdd             = true;
                allowRemove          = true;
                _useHandlerInterface = false;
            }
            else if (CollectionItemType == typeof(SecurityDevice))
            {
                frmCollectionEditorForm.Text = "Security Devices Collection Editor";
                allowAdd             = true;
                allowRemove          = true;
                _useHandlerInterface = false;
            }
            else if (CollectionItemType == typeof(SecurityConnection))
            {
                frmCollectionEditorForm.Text = "Security Connections Collection Editor";
                allowAdd             = true;
                allowRemove          = true;
                _useHandlerInterface = false;
            }
            else if (CollectionItemType == typeof(SubReport))
            {
                frmCollectionEditorForm.Text = "Sub-Reports Collection Editor";
                allowRemove          = true;
                _useHandlerInterface = true;
            }
            else if (CollectionItemType == typeof(ReportViewPartialTemplate))
            {
                frmCollectionEditorForm.Text = "Partial Templates Collection Editor";
                _useHandlerInterface         = false;
            }
            else if (CollectionItemType == typeof(CommonScript))
            {
                frmCollectionEditorForm.Text = "Common Script Collection Editor";
                allowAdd             = true;
                allowRemove          = true;
                _useHandlerInterface = (TemplateTextEditor.CurrentEntity is Report);
            }

            TableLayoutPanel tlpLayout = frmCollectionEditorForm.Controls[0] as TableLayoutPanel;

            if (tlpLayout != null)
            {
                // Get a reference to the inner PropertyGrid and hook
                // an event handler to it.
                if (tlpLayout.Controls[5] is PropertyGrid)
                {
                    PropertyGrid propertyGrid = tlpLayout.Controls[5] as PropertyGrid;
                    propertyGrid.HelpVisible           = true;
                    propertyGrid.ToolbarVisible        = false;
                    propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(propertyGrid_PropertyValueChanged);
                    propertyGrid.LineColor             = SystemColors.ControlLight;
                    propertyGrid.Tag = _component;
                }
            }

            //Hide Add/Remove -> Get the forms type
            if (!allowRemove)
            {
                Type      formType  = frmCollectionEditorForm.GetType();
                FieldInfo fieldInfo = formType.GetField("removeButton", BindingFlags.NonPublic | BindingFlags.Instance);
                if (fieldInfo != null)
                {
                    System.Windows.Forms.Control removeButton = (System.Windows.Forms.Control)fieldInfo.GetValue(frmCollectionEditorForm);
                    removeButton.Hide();
                }
            }

            if (!allowAdd)
            {
                Type      formType  = frmCollectionEditorForm.GetType();
                FieldInfo fieldInfo = formType.GetField("addButton", BindingFlags.NonPublic | BindingFlags.Instance);
                if (fieldInfo != null)
                {
                    System.Windows.Forms.Control addButton = (System.Windows.Forms.Control)fieldInfo.GetValue(frmCollectionEditorForm);
                    addButton.Hide();
                }
            }
            return(collectionForm);
        }
Exemplo n.º 9
0
 private void changeControlShow(Control control, bool show)
 {
     if (control.InvokeRequired)
     {
         control.Invoke(controlChange, control, show);
     }
     else
     {
         if (show) control.Show();
         else control.Hide();
     }
 }
Exemplo n.º 10
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();
       }
 }
Exemplo n.º 11
0
		public void TestPublicMethods ()
		{
			// Public Methods that force Handle creation:
			// - CreateControl ()
			// - CreateGraphics ()
			// - GetChildAtPoint ()
			// - Invoke, BeginInvoke throws InvalidOperationException if Handle has not been created
			// - PointToClient ()
			// - PointToScreen ()
			// - RectangleToClient ()
			// - RectangleToScreen ()
			Control c = new Control ();
			
			c.BringToFront ();
			Assert.IsFalse (c.IsHandleCreated, "A1");
			c.Contains (new Control ());
			Assert.IsFalse (c.IsHandleCreated, "A2");
			c.CreateControl ();
			Assert.IsTrue (c.IsHandleCreated, "A3");
			c = new Control ();
			Graphics g = c.CreateGraphics ();
			g.Dispose ();
			Assert.IsTrue (c.IsHandleCreated, "A4");
			c = new Control ();
			c.Dispose ();
			Assert.IsFalse (c.IsHandleCreated, "A5");
			c = new Control ();
			//DragDropEffects d = c.DoDragDrop ("yo", DragDropEffects.None);
			//Assert.IsFalse (c.IsHandleCreated, "A6");
			//Assert.AreEqual (DragDropEffects.None, d, "A6b");
			//Bitmap b = new Bitmap (100, 100);
			//c.DrawToBitmap (b, new Rectangle (0, 0, 100, 100));
			//Assert.IsFalse (c.IsHandleCreated, "A7");
			//b.Dispose ();
			c.FindForm ();
			Assert.IsFalse (c.IsHandleCreated, "A8");
			c.Focus ();
			Assert.IsFalse (c.IsHandleCreated, "A9");

			c.GetChildAtPoint (new Point (10, 10));
			Assert.IsTrue (c.IsHandleCreated, "A10");
			c.GetContainerControl ();
			c = new Control ();
			Assert.IsFalse (c.IsHandleCreated, "A11");
			c.GetNextControl (new Control (), true);
			Assert.IsFalse (c.IsHandleCreated, "A12");
#if NET_2_0
			c.GetPreferredSize (Size.Empty);
			Assert.IsFalse (c.IsHandleCreated, "A13");
#endif
			c.Hide ();
			Assert.IsFalse (c.IsHandleCreated, "A14");
			c.Invalidate ();
			Assert.IsFalse (c.IsHandleCreated, "A15");
			//c.Invoke (new InvokeDelegate (InvokeMethod));
			//Assert.IsFalse (c.IsHandleCreated, "A16");
			c.PerformLayout ();
			Assert.IsFalse (c.IsHandleCreated, "A17");
			c.PointToClient (new Point (100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A18");
			c = new Control ();
			c.PointToScreen (new Point (100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A19");
			c = new Control ();
			//c.PreProcessControlMessage   ???
			//c.PreProcessMessage          ???
			c.RectangleToClient (new Rectangle (0, 0, 100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A20");
			c = new Control ();
			c.RectangleToScreen (new Rectangle (0, 0, 100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A21");
			c = new Control ();
			c.Refresh ();
			Assert.IsFalse (c.IsHandleCreated, "A22");
			c.ResetBackColor ();
			Assert.IsFalse (c.IsHandleCreated, "A23");
			c.ResetBindings ();
			Assert.IsFalse (c.IsHandleCreated, "A24");
			c.ResetCursor ();
			Assert.IsFalse (c.IsHandleCreated, "A25");
			c.ResetFont ();
			Assert.IsFalse (c.IsHandleCreated, "A26");
			c.ResetForeColor ();
			Assert.IsFalse (c.IsHandleCreated, "A27");
			c.ResetImeMode ();
			Assert.IsFalse (c.IsHandleCreated, "A28");
			c.ResetRightToLeft ();
			Assert.IsFalse (c.IsHandleCreated, "A29");
			c.ResetText ();
			Assert.IsFalse (c.IsHandleCreated, "A30");
			c.SuspendLayout ();
			Assert.IsFalse (c.IsHandleCreated, "A31");
			c.ResumeLayout ();
			Assert.IsFalse (c.IsHandleCreated, "A32");
#if NET_2_0
			c.Scale (new SizeF (1.5f, 1.5f));
			Assert.IsFalse (c.IsHandleCreated, "A33");
#endif
			c.Select ();
			Assert.IsFalse (c.IsHandleCreated, "A34");
			c.SelectNextControl (new Control (), true, true, true, true);
			Assert.IsFalse (c.IsHandleCreated, "A35");
			c.SetBounds (0, 0, 100, 100);
			Assert.IsFalse (c.IsHandleCreated, "A36");
			c.Update ();
			Assert.IsFalse (c.IsHandleCreated, "A37");
		}
Exemplo n.º 12
0
		public OpenTKGLContext( Control control, Control parent )
		{
			// replaces form's (parent) picturebox (control) by glControl
			this.glControl = new GLControl();
			this.glControl.VSync = false;
			this.glControl.Dock = control.Dock;
			this.glControl.BackColor = control.BackColor;
			this.glControl.Location = control.Location;
			this.glControl.Name = control.Name;
			this.glControl.Size = control.Size;
			this.glControl.TabIndex = control.TabIndex;
			this.glControl.Show();

			int count = 0;
			while ( this.glControl.Context == null && ++count < 10 )
			{
				System.Threading.Thread.Sleep( 10 );
			}
			if ( this.glControl.Context == null )
			{
				throw new Exception( "glControl.Context == null" );
			}

			var form = (Form)parent;
			form.Controls.Add( this.glControl );
			control.Hide();

			if (
				ResourceGroupManager.Instance.FindResourceFileInfo( ResourceGroupManager.DefaultResourceGroupName, "AxiomIcon.ico" )
					.Count > 0 )
			{
				using ( System.IO.Stream icon = ResourceGroupManager.Instance.OpenResource( "AxiomIcon.ico" ) )
				{
					if ( icon != null )
					{
						form.Icon = new System.Drawing.Icon( icon );
					}
				}
			}
			Initialized = true;
		}
Exemplo n.º 13
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();
        }
Exemplo n.º 14
0
 public void VisibilityIsSetToUIElementWhenWrapperHides()
 {
     Wf.Control wrapper = catalog.Wrap(uiElement);
     wrapper.Hide();
     Assert.AreEqual(Visibility.Hidden, uiElement.Visibility);
 }
Exemplo n.º 15
0
 void showComponent(Control c, bool show = false)
 {
     if (show == false)
     {
         c.Hide();
     }
     else
     {
         c.Show();
     }
 }
Exemplo n.º 16
0
        public void Increment_State()
        {
            faze++;
            float inc, ptinc;
            int   divide = Acceleration;

            //float BounceCoef = 1/2+1/2*Acceleration;
            //float BounceCoef = 3/4;

            if (faze < endfaze / 4)
            {
                inc = increment / divide;     ptinc = ptincrement / divide;
            }
            else
            {
                if (faze < endfaze / 2)
                {
                    inc = increment; ptinc = ptincrement;
                }
                else
                {
                    if ((faze <= (int)endfaze * 3 / 4 && Bounce) || (!Bounce && faze < (int)endfaze * 3 / 4))
                    {
                        inc   = ((endfaze * increment) / 2 - (increment * endfaze) / (4 * divide)) / (endfaze / 4);
                        ptinc = ((endfaze * ptincrement) / 2 - (ptincrement * endfaze) / (4 * divide)) / (endfaze / 4);
                    }
                    else
                    {
                        inc   = increment + rest / (endfaze / 4);
                        ptinc = ptincrement + ptrest / (endfaze / 4);
                    }
                }
            }

            Size sz = control.Size;

            sz.Height -= (int)inc;
            Point pt = control.Location;

            pt.Y += (int)ptinc;
            if (faze == endfaze)
            {
                if (!up)
                {
                    control.Hide();
                    sz = startSize;
                    pt = startPoint;
                }
                else
                {
                    sz = endSize;
                    pt = endPoint;
                }
            }
            if (!up)
            {
                control.Size     = sz;
                control.Location = pt;
            }
            else
            {
                control.Location = pt;
                control.Size     = sz;
            }
        }
Exemplo n.º 17
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;
     }
 }