Return Value
System.Drawing.Size object that represents the size of the content, in pixels.
int GetMaximumCellWidth(int col) { // maximum width is unknown int maxWidth = -1; // scan all rows to find the widest content for (int row = 0; row < _flex.Rows.Count; row++) { // get cell content string text = _flex.GetDataDisplay(row, col); // check that the cell contains html if (!string.IsNullOrEmpty(text) && text.StartsWith("<html>")) { // measure width needed to render the Html _superLabel.Text = text; int width = _superLabel.Measure().Width; // save maximum width if (width > maxWidth) maxWidth = width; } return maxWidth; }