如何创建特定于分辨率的列表框?
我正在开发 silverlight 应用程序。我的应用程序中有一个列表框。我正在与该列表框进行动态绑定。我的 xaml 和用于动态绑定的代码隐藏代码位于以下链接中。在以下链接中,第二个文本块包含的文本比以下链接中显示的文本多得多
我想在列表框调整大小时调整列表框中存在的文本块的大小。为此,我参考了以下两个链接。
http://forums.silverlight.net/forums/p/19787/518178。 ASPX http://forums.silverlight.net/forums/p/18918/ 70469.aspx#70469
在上面的两个链接中,我可以看到,当我更改计算机的分辨率时,列表框的宽度会发生变化。 代码看到这一点
vGrid.Width = lstbox1.ActualWidth;
我可以通过上面链接中的 。但是列表框中存在的文本块的宽度不会改变,因为它不会拉伸以适合列表框的大小。现在我还想在列表框调整大小时更改列表框中存在的文本块的宽度。我使用的是Windows 7操作系统。怎么办呢?您能否提供任何代码或链接来解决上述问题。如果我做错了什么,请指导我。
I am developing silverlight application. I have a listbox in my application. I am doing dynamic binding with that listbox. My xaml and code behind code for dynamic binding is present in the following link. In the following link the second textblock contains the much more text than appear in the following link
How to do dynamic binding with Listbox in silverlight?
I want to resize the textblock present in the listbox as the listbox resize. For that I am referring the following two links.
http://forums.silverlight.net/forums/p/19787/518178.aspx
http://forums.silverlight.net/forums/p/18918/70469.aspx#70469
In the above two links I can see that as I change the resolution of computer, the width of my listbox changes. I can see that with the code
vGrid.Width = lstbox1.ActualWidth;
in the above link. But the width of the textblock present inside the lisbox does not change because it does not stretch to fit in the size of the listbox. Now I also want to change the width of the textblock present in the listbox as the listbox resizes. I am using windows 7 operating system. How to do that ? Can you please provide me any code or link through which I can resolve the above issue. If I am doing anything wrong then please guide me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案。解决方案如下
有关更多详细信息,您可以参考链接 - 如何让 ListBox ItemTemplate 水平拉伸 ListBox 的整个宽度?
I found the solution. The solution is as follows
For more details you can refer the link - How to get a ListBox ItemTemplate to stretch horizontally the full width of the ListBox?