Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Odd Control Behavior or Bug - TextBox does not show cursor unless entire Silverlight 2 control loses focus and comes back
9 replies. Latest Post by johnpapa on June 17, 2008.
(0)
johnpapa
Member
8 points
9 Posts
06-17-2008 3:41 PM |
I have a textbox on a usercontrol, with no styles. It has its Text property == “Hello”. When the control first loads, I can click in it and type, but I do not see the cursor. I have to minimize the entire IE window then come back before I can see the cursor in the textbox. At first I just ignored this. But then I noticed that TwoWay binding was not working for me due to this. For example, the textbox is bound TwoWay to an entity … the value also shows up in a TextBlock. When I type in the TextBox (when it first loads and I cannot see the cursor) the value is not updated in the TextBlock. However, if I minimize the IE instance and go back to it, everything works great. Has anyone ever seen anything like this in Silverlight 2 Beta 2?
Here is my sample code. When I first run this I cannot select the text til I go off the window and back (switch windows). Note that the problem occurs if you browse to the page with the silverlight control on it. However if you run the app in VS the problem does not happen.
<
</
sladapter
All-Star
17439 points
3,172 Posts
06-17-2008 4:13 PM |
Are you using IE7? I just tested on IE7 and Firefox, both worked fine without the problem you described.
I just saw that there is another post in the forums on this same issue.
http://silverlight.net/forums/t/12865.aspx
Jhorra
522 points
475 Posts
06-17-2008 4:20 PM |
It doesn't do it for me, but my boss has the issue on his computer.
06-17-2008 4:27 PM |
I found out more information on this.
(Oh, and yes I am using IE 7. )
It works fine if I right click in Visual Studio and browse to the page (or from Blend). I imagine it will work any tim eyou open a new browser window. However, it does NOT work if I refresh the page in the browser window. So try hitting refresh in the brwoser and see if it works.
06-17-2008 4:28 PM |
In beta 1, I have seen this message when I first load the Silverlight HTML page: "click to activate and use this control silverlight control". Which means the Silverlight control is not active until you first click on the page or press space bar. Do you see this message? I had a workaround in the html page to get rid of it in beta 1 and it only happened on the html page not on the aspx page.
But since beta2, I haven't seen this problem again. Maybe I had some latest patch for IE fixed that. Because that was not Silverlight specific problem. It was a problem for all the object tags in IE. I'm not sure if you are having this problem or not.
06-17-2008 4:36 PM |
No, I do not get that message. The page simply appears and you cannot see the cursor in the textbox nor select anything in it til you move out of the silverlight control and back in.
Mark Rid...
Contributor
2357 points
273 Posts
06-17-2008 5:16 PM |
There is a bug about this that will be fixed after Beta 2. I'm not sure of all the circumstances for when it occurs, but usually (not always) it occurs if the TextBox is the first control to receive focus when you start your app. If it is the second control and you tab to it or click in it then it usually works.
-markSilverlight Program ManagerMicrosoftThis post is provided "as-is"
06-17-2008 5:22 PM |
I used refresh button, still works.
I also tested on several machines, one with IE6 and other one with IE7 without the latest patch. On those two machines I see "Click to activate this control" message. But when I clicked on the Textbox, that message went away. The Textbox immediately got the focus and cursor was shown on the box.
06-17-2008 9:45 PM |
Mark ... thanks. Good to know.
I just have to find a stable workaround for my app for now.