The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: How to Add DoubleClick to a ListBox in Silverlight and C#
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

shital pangarePosted Dec 29, 2011, 7:01 AM
Hi,Mike My Question is Suppose when i first click On button Visible some textbox But On next click I want Hide or collapsed that textBox So What is solution To Do this ?
Eyo EyoPosted Jun 18, 2011, 6:32 AM
Hi, When adding the double click directly to textblock it works nicely, however, if I try to use it as above from within a listbox it will not work. Please could you attach a sample project.
Mike GoldPosted Dec 8, 2010, 11:34 AM
If you have textboxes as the content of your datatemplate, they won't stretch across to fill the listbox. You'll need to do a little trick in Silverlight to make this happen. You can use the ItemsContainerStyle to tell the item to stretch. (putting Horizontal alignment stretch on the textbox won't work) Below is the solution:: Add this to your ListBox in XAML ItemContainerStyle="{StaticResource StretchItemAcross}" And create a style in your Resources: <Style x:Key="StretchItemAcross" TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> </Style>