IE hosted control css display style

G

Guest

We have a run into an apparent bug involving the rendering of .NET winform
controls within IE 6 (running on XP sp2 and .NET 2.0) . If one of a hosted
control's parent elements has style.display == 'none' when the control is
created,
the width and height of the control will be 0. If the parent element's
display style is then changed to 'visible' then the control's size remains 0.

To demonstrate the problem I have posted a website / user control project at
http://www.bluewire-technologies.com/downloads/UCTest.zip. This should be
unzipped to wwwroot and then access by pointing IE at
http://localhost/UcTest/index.html.

This issue is causing us big headaches as we use lots of hosted controls to
provide Tablet PC ink functionality in our web app. Any help would be greatly
appreciated!
 
J

Jeffrey Tan[MSFT]

Hi willholley,

Thanks for your post.

For CSS display property, there is no 'visible' value, the available values
are:
none, list-item, inline and block .

So I suspect you just turn on and turn off none value of the div element.
Yes?

I still did not have time to do test on your specific winform control.
However, I have tried to use the control provided in the link below:
http://samples.gotdotnet.com/quickstart/winforms/doc/WinFormsIeSourcing.aspx

I place this control in a div, then I turn on and turn off the display
property, like this:

function ChangeVisible(){
var div = document.getElementById("testdiv");
div.style.display="block";

}

function tonone(){
var div = document.getElementById("testdiv");
div.style.display="none";
}

The control disappear and reappear without any problem. So I suggest you
test this link sample first. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi willholley,

Oh, I just did some test by using your control. I found that your problem
may lie in your code. In order to show this Button in the usercontrol, we
should add Button into UserControl.Controls property, not just set
Button.Parent to UserControl, modified code below works well on my side now:

namespace UCTest
{
public class WebButton : UserControl
{
private Button _button;

public WebButton()
{
_button = new Button();
_button.Dock = DockStyle.Fill;
this.Controls.Add(_button);
_button.Text = "It works";
}
}
}
Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Hi Jeffrey,

Thanks for the reply - my bad with the display property - I mean't to say
set it to block. Having changed the user control to the code you suggested, I
still get the bug (to see the bug you need to uncomment a section in the
html) - the user control appears as a black dot (height and width are zero)
when display attribute toggled.

Will Holley
 
J

Jeffrey Tan[MSFT]

Hi Will ,

Thanks for your feedback.

Oh, yes, after uncommenting out the #divBroken CSS style, I can reproduce
out your problem.

After doing some further test, I found that this problem only occurs with
..Net2.0(Note: IE will use the highest CLR version on the machine to run
winform control). For example, if we use VS.net2003 to create a sample
control, then host it in IE. When we use a XP machine with .Net1.1 to
access this page, it will work well without this problem. However, if we
use any machine with .Net2.0 installed to access it, we will get the black
dot you mentioned.

Can you try to test this on WinXP .Net1.1 machine to confirm my suspicion?
I look forward to hearing from you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Hi Jeff,

That certainly sounds like a viable cause - we converted all of our hosted
controls over to .NET 2 a couple of months ago in the hope that the new CLR
would be more stable when hosted and give us more information when things
went bad (in 1.1 IE would frequently die with no error message).

I am out of the office for the next 10 days but I have passed the post onto
a collegue and should be able to get back to you towards the end of next week
when he tests your hypothesis.

Kind regards,

Will Holley
 
J

Jeffrey Tan[MSFT]

Ok, I will wait for your further confirmation. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Jeffry,

I have tried the control in 1.1 and yes, the bug appears to go away, so it
would appear to be a bug 2.0.

Will
 
J

Jeffrey Tan[MSFT]

Hi Will,

Thanks for your feedback.

Yes, it seems that we got the same result. For this issue, I think it
should be a bug of .Net2.0, I suggest you submit this bug in the link
below. Then our developer team will follow up with your bug request and
work with you:
http://lab.msdn.microsoft.com/ProductFeedback/

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Hi Jeffrey,

Thanks for your help. I have submitted a bug report so hoping for a fix /
workaround soon!

Will
 
J

Jeffrey Tan[MSFT]

Hi Will,

You are welcome.

If you got any useful progress, please feel free to feedback here. I think
it is a good resource to share with the community. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Jeffrey,

I posted a bug report at
http://lab.msdn.microsoft.com/produ...edbackid=b0a31908-9442-438f-9a0f-c38102350525
a few weeks ago (and it has been voted for by a number of others now) but the
team has not given any feedback as yet. I notice for most other bugs reports
the teams are quite quick to respond. Is there anything you can do to find
out if they have acknowledged this issue? If we open a full support request
will the bug get resolved any quicker?

Kind regards,

Will Holley
 
J

Jeffrey Tan[MSFT]

Hi Will,

Thanks for your feedback.

Yes, I have just checked the internal bug database for this issue, I found
that in 3/19, our developer team has replied to you with the following
message:
"Thanks for your feedback, using Visual Studio 2005 (build:RTM.50727.42) we
were unable to repro the bug with the scenario and/or steps provided. If
you still see this issue occurring we would like to investigate this issue
again. Please provide the exact steps/actions to reproduce the problem and
we will re-investigate.

Thank you,
Nagesh, Visual Studio Product Team."

I am not sure why this message did not appear in the webpage.

Regarding this issue, I found that there are some errors in your attached
sample reproduce project.

First, just as we discussed in the first message, we should add Button into
UserControl.Controls property, not just set Button.Parent to UserControl.

Second, in your index.html, it seems that you did not use "#divBroken" CSS
style on the usercontrol. So it will not take effect on it. So you should
add class="divBroken" attribute in <OBJECT> tag.

After adding this modification, we can reproduce out the problem. So I
suggest you apply these modification and reopen this thread. Hope this
helps!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Thanks Jeff - I will repost the zip. I did explicitly say in the bug report
that the style rule must be uncommented to reproduce the bug - they obviously
didnt look inside the HTML file or read this thread (which I also mentioned)
to try and reproduce it!

Will
 
J

Jeffrey Tan[MSFT]

Hi Will,

I suspect that because your original project did not add the button into
UserControl.Controls property collection, so they may can not reproduce the
problem. Also, I suggest you mention that only XP will have this problem.
Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Hi Jeff,

What should I do to reopen the issue? Is there anything you can do at your
end to get them to look at it again and see how we reproduced the error in
this thread?

Will
 
J

Jeffrey Tan[MSFT]

Hi Will,

Can you please re-open that bug request thread and notify that you have
modified the sample project, which can be used to reproduce this bug?(I
have just downloaded the uctest2.zip project, and I can confirm that this
project can be used to reproduce out the problem)

Our product team will receive this and follow up with you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Thanks Jeff,

What should I do to reopen the issue? I have changed the ticket and posted a
comment but have recieved no response. Is there anything you can do at your
end to push this along or show them how to reproduce the issue?

Kind regards,

Will
 
J

Jeffrey Tan[MSFT]

Ok, Will.

I have send an email to the bug owner. I hope he will give it a re-check
sometime later. I will feedback any further progress here. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hi Jeff,

Many thanks for pushing that on - apologies for posting basically the same
message twice - firefox was caching the thread so thought my first one didnt
get there!

Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top