WPF中Label类的.net文本的替代方法

编程入门 行业动态 更新时间:2024-10-26 05:24:36
本文介绍了WPF中Label类的文本的替代方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是WPF的新手. 我通过在Windows Label类上包装在vb中创建了标签控件. 现在,我想将Label控件从迁移到WPF. 我遇到了的问题 Mybase.Text. WPF的标签类中没有文本错误. WPF的Label类中是否有替代文本. 还可以请您分享与从迁移到WPF的任何文档吗? 预先感谢, Vijay

Hi, I am new to WPF. I have label control created in vb by wrapping on windows Label class. Now I want to migrate Label control from to WPF. I am facing a problem with Mybase.Text. The error being text is not present in label class of WPF. Is there any alternative for text in Label class of WPF. Also could you please share any document related to migration from to WPF Thanks in advance, Vijay

推荐答案

WPF *是* .NET的一部分.我假设.Net的意思是Windows窗体("winforms"). WPF需要一种非常不同的方式来考虑用户界面编程.从winforms进行直接转换"并不简单. 关于WPF的很多好书,我现在想都没想到. ;) 无论如何,与Winforms Label.Text最接近的WPF Label对象的属性为Content,并且其类型为object. WPF允许Label实质上包含 任何 ,包括另一个UIElement(或UIElement结构),字符串或... WPF *is* part of .NET. I''m assuming that by .Net you really mean Windows Forms ("winforms"). WPF requires a very different way of thinking about User Interface programming. A "straight conversion" from winforms is not simple. There are plenty of good books on WPF, none of which I can think of right now. ;) In any case, the property of the WPF Label object that most closely corresponds to the winforms Label.Text is Content, and it is of type object. WPF allows a Label to contain essentially anything, including another UIElement (or UIElement structure), string, or ...

更多推荐

WPF中Label类的.net文本的替代方法

本文发布于:2023-11-15 17:25:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1596473.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本   方法   WPF   Label   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!