private bool ShouldShowScrollbar(ImageBoxScrollBarStyle style, bool visible) { bool result; switch (style) { case ImageBoxScrollBarStyle.Auto: result = visible; break; case ImageBoxScrollBarStyle.Show: result = true; break; case ImageBoxScrollBarStyle.Hide: result = false; break; default: throw new ArgumentOutOfRangeException("style", style, null); } return result; }