コード例 #1
0
        protected override void OnControlDefaultSizeChanged(RadPropertyChangedEventArgs e)
        {
            RadControl control1 = this.ElementTree.Control as RadControl;

            if (control1 == null || control1.AutoSize)
            {
                return;
            }
            control1.GetControlDefaultSize();
            Size         newValue = (Size)e.NewValue;
            RadScrollBar control2 = this.ElementTree.Control as RadScrollBar;

            if (control2 == null)
            {
                return;
            }
            if (control2.ScrollType == ScrollType.Vertical)
            {
                if (control1.Size.Width >= newValue.Width)
                {
                    return;
                }
                control1.Width = newValue.Width;
            }
            else
            {
                if (control1.Size.Height >= newValue.Height)
                {
                    return;
                }
                control1.Height = newValue.Height;
            }
        }
コード例 #2
0
ファイル: RootRadElement.cs プロジェクト: RichardHaggard/BDC
        protected virtual void OnControlDefaultSizeChanged(RadPropertyChangedEventArgs e)
        {
            RadControl control = this.ElementTree.Control as RadControl;

            if (control == null || control.AutoSize)
            {
                return;
            }
            Size controlDefaultSize = control.GetControlDefaultSize();
            Size newValue           = (Size)e.NewValue;

            if (controlDefaultSize == control.Size || control.Size == Size.Empty)
            {
                control.Size = newValue;
            }
            else
            {
                if (control.Size.Height >= newValue.Height)
                {
                    return;
                }
                control.Height = newValue.Height;
            }
        }