System.Windows.Forms.Control.SizeFromClientSize(System.Drawing.Size)

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

5 Examples 7

1. Example

Project: NanUI
Source File: ModernUIForm.cs
protected override Size SizeFromClientSize(Size clientSize)
		{

			if (!IsDesignMode)
			{
				return base.SizeFromClientSize(clientSize);
			}

			return CalcSizeFromClientSize(clientSize);
		}

2. Example

Project: Sardauscan
Source File: CustomAppForm.cs
protected override Size SizeFromClientSize(Size clientSize)
		{
			if (!EnableNonClientAreaPaint)
				return base.SizeFromClientSize(clientSize);

			return SizeFromClientSize(clientSize.Width, clientSize.Height, false);
		}

3. Example

Project: TaskScheduler
Source File: CustomComboBox.cs
protected Size SizeFromContent(int width)
			{
				Size contentSize = Size.Empty;

				m_refreshSize = false;

				// Fetch hosted control.
				Control hostedControl = GetHostedControl();
				if (hostedControl != null)
				{
					if (CompareResizeMode(PopupResizeMode.TopLeft) || CompareResizeMode(PopupResizeMode.TopRight))
						hostedControl.Location = new Point(1, 16);
					else
						hostedControl.Location = new Point(1, 1);
					contentSize = SizeFromClientSize(hostedControl.Size);

					// Use minimum width (if specified).
					if (width > 0 && contentSize.Width < width)
					{
						contentSize.Width = width;
						m_refreshSize = true;
					}
				}

				// If a grip box is shown then add it into the drop down height.
				if (IsGripShown)
					contentSize.Height += 16;

				// Add some additional space to allow for borders.
				contentSize.Width += 2;
				contentSize.Height += 2;

				return contentSize;
			}

4. Example

Project: tesvsnip
Source File: PopupControl.cs
protected Size SizeFromContent(int width)
        {
            Size contentSize = Size.Empty;

            m_refreshSize = false;

            // Fetch hosted control.
            Control hostedControl = GetHostedControl();
            if (hostedControl != null)
            {
                if (CompareResizeMode(PopupResizeMode.TopLeft) || CompareResizeMode(PopupResizeMode.TopRight))
                    hostedControl.Location = new Point(1, 16);
                else
                    hostedControl.Location = new Point(1, 1);
                contentSize = SizeFromClientSize(hostedControl.Size);

                // Use minimum width (if specified).
                if (width > 0 && contentSize.Width < width)
                {
                    contentSize.Width = width;
                    m_refreshSize = true;
                }
            }

            // If a grip box is shown then add it into the drop down height.
            if (IsGripShown)
                contentSize.Height += 16;

            // Add some additional space to allow for borders.
            contentSize.Width += 2;
            contentSize.Height += 2;

            return contentSize;
        }

5. Example

Project: falloutsnip
Source File: PopupControl.cs
protected Size SizeFromContent(int width)
        {
            Size contentSize = Size.Empty;

            m_refreshSize = false;

            // Fetch hosted control.
            Control hostedControl = GetHostedControl();
            if (hostedControl != null)
            {
                if (CompareResizeMode(PopupResizeMode.TopLeft) || CompareResizeMode(PopupResizeMode.TopRight))
                    hostedControl.Location = new Point(1, 16);
                else
                    hostedControl.Location = new Point(1, 1);
                contentSize = SizeFromClientSize(hostedControl.Size);

                // Use minimum width (if specified).
                if (width > 0 && contentSize.Width < width)
                {
                    contentSize.Width = width;
                    m_refreshSize = true;
                }
            }

            // If a grip box is shown then add it into the drop down height.
            if (IsGripShown)
                contentSize.Height += 16;

            // Add some additional space to allow for borders.
            contentSize.Width += 2;
            contentSize.Height += 2;

            return contentSize;
        }