System.Windows.Forms.ScrollBar.CalcThumbArea C# (CSharp) Method

CalcThumbArea() private method

private CalcThumbArea ( ) : void
return void
		private void CalcThumbArea ()
		{
			int lchange = use_manual_thumb_size ? manual_thumb_size : LargeChange;

			// Thumb area
			if (vert) {

				thumb_area.Height = Height - scrollbutton_height -  scrollbutton_height;
				thumb_area.X = 0;
				thumb_area.Y = scrollbutton_height;
				thumb_area.Width = Width;

				if (Height < thumb_notshown_size)
					thumb_size = 0;
				else {
					double per =  ((double) lchange / (double)((1 + maximum - minimum)));
					thumb_size = 1 + (int) (thumb_area.Height * per);

					if (thumb_size < thumb_min_size)
						thumb_size = thumb_min_size;
						
					// Give the user something to drag if LargeChange is zero
					if (LargeChange == 0)
						thumb_size = 17;
				}

				pixel_per_pos = ((float)(thumb_area.Height - thumb_size) / (float) ((maximum - minimum - lchange) + 1));

			} else	{

				thumb_area.Y = 0;
				thumb_area.X = scrollbutton_width;
				thumb_area.Height = Height;
				thumb_area.Width = Width - scrollbutton_width -  scrollbutton_width;

				if (Width < thumb_notshown_size)
					thumb_size = 0;
				else {
					double per =  ((double) lchange / (double)((1 + maximum - minimum)));
					thumb_size = 1 + (int) (thumb_area.Width * per);

					if (thumb_size < thumb_min_size)
						thumb_size = thumb_min_size;
						
					// Give the user something to drag if LargeChange is zero
					if (LargeChange == 0)
						thumb_size = 17;
				}

				pixel_per_pos = ((float)(thumb_area.Width - thumb_size) / (float) ((maximum - minimum - lchange) + 1));
			}
		}