SteveG asked 2017-05-09 09:24:00 UTC
Hi
I have a problem with displaying some HTML on a usercontrol.
Basically what I have is a standard usercontrol with an HtmlBox on it that has been Dock.Fill inside the parent container (the usercontrol) - that is it.
I am feeding in some html via the constructor on the usercontrol and setting the html via the html property on the HtmlBox. The usercontrol height is set at 700 in the designer and resized at runtime to 400
public advertWindowL(string html, string height)
{
InitializeComponent();
if (height != null)
{
this.Height = Convert.ToInt32(height);
htmlPanel1.Height = Convert.ToInt32(height);
}
htmlPanel1.Html = html.Trim();
}
The (test) html is -
Test Title
Hello, World xxx!
You can modify the text in the box to e ft any way you like, and then click the 'Show Page' button below the box to display the result here. Go ahead and do this as often and as long as you like.
The problem is only half the htmlbox will load as you can see in the attachment. The dotted line is the htmlbox1.borderstyle set to dotted so you can see the control boundaries.
If I hit F5 the majority of the time the htmlbox will then load correctly, however, not always. Sometimes it takes 2 or 3 refreshes before it will display properly.
Anyone any clue as to what is going on here ?
Thanks
Steve
SteveG asked 2017-05-09 09:24:00 UTC
Hi
I have a problem with displaying some HTML on a usercontrol.
Basically what I have is a standard usercontrol with an HtmlBox on it that has been Dock.Fill inside the parent container (the usercontrol) - that is it.
I am feeding in some html via the constructor on the usercontrol and setting the html via the html property on the HtmlBox. The usercontrol height is set at 700 in the designer and resized at runtime to 400
public advertWindowL(string html, string height)
{
InitializeComponent();
if (height != null)
{
this.Height = Convert.ToInt32(height);
htmlPanel1.Height = Convert.ToInt32(height);
}
htmlPanel1.Html = html.Trim();
}
The (test) html is -
Test Title
Hello, World xxx!
You can modify the text in the box to e ft any way you like, and then click the 'Show Page' button below the box to display the result here. Go ahead and do this as often and as long as you like.
The problem is only half the htmlbox will load as you can see in the attachment. The dotted line is the htmlbox1.borderstyle set to dotted so you can see the control boundaries.
If I hit F5 the majority of the time the htmlbox will then load correctly, however, not always. Sometimes it takes 2 or 3 refreshes before it will display properly.
Anyone any clue as to what is going on here ?
Thanks
Steve