This project is read-only.

MinimumSize.Height ignored on HtmlLabel

Oct 21, 2013 at 9:24 AM
It seems that the MinimumSize.Height value is ignored for the HtmlLabel, at least when the control is in AutoSizeHeightOnly mode. Looking at the OnLayout code I think that the following change fixes this.

Height = (int)_htmlContainer.ActualSize.Height;
if (MinimumSize.Height > 0 && MinimumSize.Height > _htmlContainer.ActualSize.Height) 
  Height = MinimumSize.Height;
  else Height = (int)_htmlContainer.ActualSize.Height;
Oct 21, 2013 at 3:47 PM
Setting the MinimumSize in the "Sample Form" for the label works...
I think the label knows how to handle MinimumSize layout itself...
Oct 22, 2013 at 8:18 AM
I've tried to reproduce this in a simple test example. So far I get it working runtime, but then I see issues design time, similar to what I experience at runtime in the project where I use HtmlRenderer.

I have the HtmlLabel in a TableLayout cell with autosize rowstyle, docked to the top. Without the above modification, the row doesn't always change size, even if the label does. Try the the following with the test example below:
  • Open the form in the designer.
  • Change MinimumSize for the HtmlLabel to "0;250"
  • Right click on the table and insert a column
You should see that changing the minimum height to 250 makes the label and row higher. After inserting the column the label remains 250 in height but the row itself reverts back to the previous height, which is much less.

The suggested correction corrects this behavior both runtime and designtime. It is similar to what is already being done to support MinimumSize.Width and MaximumSize...
Oct 22, 2013 at 9:57 AM
Edited Oct 22, 2013 at 9:57 AM
k, I will add it