Is there no Label control in Silverlight?

前端 未结 3 575
日久生厌
日久生厌 2021-01-18 05:39

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

3条回答
  •  深忆病人
    2021-01-18 05:39

    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.

提交回复
热议问题