SIL.FieldWorks.Discourse.ConstChartBody.GetColumnContentsWidth C# (CSharp) Method

GetColumnContentsWidth() public method

measures the width of the strings built by the display of a column and returns the maximumn width found. NOTE: you may need to add a small (e.g. under 10-pixel) margin to prevent wrapping in most cases.
public GetColumnContentsWidth ( int icolChanged ) : int
icolChanged int
return int
		public int GetColumnContentsWidth(int icolChanged)
		{
			// Review: This WaitCursor doesn't seem to work. Anyone know why?
			using (new WaitCursor())
			{
				using (var g = Graphics.FromHwnd(Handle))
				{
					// get a best estimate to determine row needing the greatest column width.
					var env = new MaxStringWidthForChartColumn(m_vc, m_styleSheet, Cache.MainCacheAccessor,
																				m_hvoChart, g, icolChanged);
					Vc.Display(env, m_hvoChart, ConstChartVc.kfragChart);
					return env.MaxStringWidth;
				}
			}
		}