User Control AutoSize question

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!

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?





  • You must to post comments

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



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

Hi Matthew,

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

Best regards

  • You must to post comments

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

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

The text in the label has CRLF?

  • You must to post comments
Showing 5 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json mixin.theme