User Control AutoSize question

0
0

I have a user control, which has a label.

I want to put some multi line text in the label, and have the label and user control resize vertically.

AutoSize seems to only size the label horizontally, not vertically.

Any help for this?

 

Thanks,

 

Matthew

  • You must to post comments
0
0

I am noticing that the label’s autosize is not really working.  At runtime, I am setting a new text (2 words) and it seems that it is not displaying the 2nd word, like the label borders are not wide enough when autosize = true.  Is this a bug that has already been fixed?

Also, on the previous note about using MeasureTextAsync,  how do you write this example in VB.NET ?

Thanks in advance

 

Robert

  • Luca (ITG)
    Send a test case please.
  • You must to post comments
0
0

Hi Matthew,

WJ-8566 and WJ-8567 are fixed in the latest Wisej release (1.4.50).

Best regards
Frank

  • You must to post comments
0
0

Try this:

private void button1_Click(object sender, EventArgs e)
{
this.label1.Text = this.tinyEditor1.Text;

Wisej.Base.TextUtils.MeasureTextAsync(this.label1.Text, true, this.label1.Font, (size) => {
this.label1.Size = size;
});
}

HTML text has to be measured on the client using Wisej.Base.TextUtils.MeasureTextAsync.

If you the set containing Panel to AutoSize=true and fix the Minimum and Maximum Width it will grow vertically to fit the content. May have to change the AutoSizeMode to GrowAndShrink if you want the panel to shrink.

There is also a bug with the regular AutoSize implementation of Label and Button not considering CRLF to grow vertically and not using the Min/Max constraints.

 

  • Frank (ITG)
    Bugs are logged as WJ-8566 and WJ-8567 and will be fixed in the next Wisej build. Regards, Frank
  • You must to post comments
0
0

The text in the label is created by the user in page of the app – using TinyEditor, so I imagine that would be “<br>”  – label is set to allowhtml.

  • You must to post comments
0
0

The text in the label has CRLF?

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.