Label text cut off

When dynamically creating a series of labels, the text in the label is cut off - as if it is being generated lower than it should. Here is an image showing the issue.

If I place the same container at design time, the label is fine. I am not manipulating the height or potion of the label in the code, as it is determined by the container it resides in.

Here’s a snippet of the only place I reference that label in code. It is when I dynamically create the control object and embed it on the page:

rWebImageView_S = New conWebImageView_Series Series.Append rWebImageView_S rWebImageView_S.SeriesOrVideo = SeriesOrVideo rWebImageView_S.LinkData = Links(x) rWebImageView_S.ImageView1.HelpTag = Tips(x) rWebImageView_S.ImageView1.URL = ImageButtons(x) rWebImageView_S.lblTitle.text = Names(x) rWebImageView_S.EmbedWithin(Self, left, 0, 166, h)

Thanks in advance for any thoughts!

This is a known bug. The style of the label is not being applied correctly.

Any word on a fix from Xojo? If not, I guess I’ll have to rebuild that section of the app to workaround. sigh

Are there any workaround suggestions for this? negative .top property or something?

You could roll your own label control with the WebSDK. You’d need to be good with HTML, CSS, and JavaScript or know where to look so you could pretend to be good at them for a few days :-).

I worked around the problem by using a canvas and drawing the text (g.DrawString) in the Paint event.

Interesting ideas. I’ll see if I can apply these in this case.

Unless I am mistaken, the font chosen for the label is in fact selected by the browser. And nothing guarantees it will be the same as the one you selected at design time. Hence possible mishaps. I would tend to use multiline labels as a workaround.

This a really nice workaround. Thanks !

@James Meyer

Good thought. I implemented the idea. While it does solve the aforementioned problem, there is a pause before the text appears. >.>

Well, It’s been some time since this post but I believe I’ve found a better workaround and want to share…

At least on xojo 2014r2 just make sure that any embedwithin is called after the shown event. I’ve set a standard “EmbedControls” method which is called from the shown event. This makes the style be applied correctly on the labels inside a container.

I appreciate your help. I have canned the project. I have found I can implement things better/faster with straight php/java and working with Vimeo. :wink: