Is there no Label control in Silverlight?

眉间皱痕 提交于 2019-12-30 18:45:22

问题


I can't seem to find a Label control in Silverlight. I get compile errors if I put anywhere in my XAML.


回答1:


TextBlock is roughly the same as a Label from WinForms.

As per MSDN:

The TextBlock control is the primary element for displaying text in Silverlight based applications.

Provides a lightweight control for displaying small amounts of text...

EDIT: I just noticed your tag for Silverlight 3. Label should be built into Silverlight 3 so are you sure your not using 2?

You might want to consider a TextBlock depending on how your using it. Again per MSDN:

A Label control displays a caption, required field indicator, and validation error indicator to the user. It is typically used together with an input control, such as a TextBox. If you do not need to display required field or validation indicators, you can use the TextBlock control instead.




回答2:


Try this article. Apparently, you need to install the Silverlight Toolkit.




回答3:


Just use the TextBlock...?

Michael



来源:https://stackoverflow.com/questions/2429420/is-there-no-label-control-in-silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!