private void EnsureRightToLeftGrip()
 {
     if (this.SizingGrip && (this.RightToLeft == RightToLeft.Yes))
     {
         this.RTLGrip.Bounds = this.SizeGripBounds;
         if (!base.Controls.Contains(this.RTLGrip))
         {
             WindowsFormsUtils.ReadOnlyControlCollection controls = base.Controls as WindowsFormsUtils.ReadOnlyControlCollection;
             if (controls != null)
             {
                 controls.AddInternal(this.RTLGrip);
             }
         }
     }
     else if ((this.rtlLayoutGrip != null) && base.Controls.Contains(this.rtlLayoutGrip))
     {
         WindowsFormsUtils.ReadOnlyControlCollection controls2 = base.Controls as WindowsFormsUtils.ReadOnlyControlCollection;
         if (controls2 != null)
         {
             controls2.RemoveInternal(this.rtlLayoutGrip);
         }
         this.rtlLayoutGrip.Dispose();
         this.rtlLayoutGrip = null;
     }
 }
Ejemplo n.º 2
0
        // in RTL, we parent a transparent control over the grip to support mirroring.
        private void EnsureRightToLeftGrip()
        {
            if (SizingGrip && RightToLeft == RightToLeft.Yes)
            {
                RTLGrip.Bounds = SizeGripBounds;
                if (!this.Controls.Contains(RTLGrip))
                {
                    WindowsFormsUtils.ReadOnlyControlCollection controlCollection = this.Controls as WindowsFormsUtils.ReadOnlyControlCollection;

                    if (controlCollection != null)
                    {
                        controlCollection.AddInternal(RTLGrip);
                    }
                }
            }
            else if (rtlLayoutGrip != null)
            {
                if (this.Controls.Contains(rtlLayoutGrip))
                {
                    WindowsFormsUtils.ReadOnlyControlCollection controlCollection = this.Controls as WindowsFormsUtils.ReadOnlyControlCollection;

                    if (controlCollection != null)
                    {
                        controlCollection.RemoveInternal(rtlLayoutGrip);
                    }
                    rtlLayoutGrip.Dispose();
                    rtlLayoutGrip = null;
                }
            }
        }
Ejemplo n.º 3
0
 // Ensures the hosted Control is parented to the ToolStrip hosting this ToolStripItem.
 private void SyncControlParent()
 {
     WindowsFormsUtils.ReadOnlyControlCollection newControls = GetControlCollection(ParentInternal);
     if (newControls != null)
     {
         newControls.AddInternal(Control);
     }
 }
 private void SyncControlParent()
 {
     WindowsFormsUtils.ReadOnlyControlCollection controlCollection = GetControlCollection(base.ParentInternal);
     if (controlCollection != null)
     {
         controlCollection.AddInternal(this.Control);
     }
 }