Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am new to WPF.

I have label control created in vb.net by wrapping on windows .net Label class.

Now I want to migrate Label control from .net 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 .net to WPF


Thanks in advance,

Vijay
Posted

1 solution

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 ...
 
Share this answer
 
Comments
Vijay hit 6-Nov-12 20:33pm    
Hi Matt,

Thanks for the information.

It helps a lot.



Regards,

Vijay
Sergey Alexandrovich Kryukov 6-Nov-12 21:50pm    
Right, and some good points here; my 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900