Please see my answer to the question. This is where you need to start:
http://msdn.microsoft.com/en-us/library/system.windows.controls.label.aspx[
^].
Also consider using this
UIElement
as an alternative:
http://msdn.microsoft.com/en-us/library/system.windows.controls.textblock.aspx[
^].
Also, I would advice to stop thinking of WPF as of "another
System.Windows.Forms
". Better try to embrace WPF approach, very different.
If this is not enough, this should help you much more than the above articles:
Microsoft Q209354.
Please, no offense. This is a joke, but the moral of it is really useful. :-)
[EDIT]
Please see my comments below. The approaches are very different, because the concept of
UIElement
if very different from
System.Windows.Forms.Control
. There is no "translation".
Let's take the borders. There are no bordered elements in WPF. And this is because they are absolutely not needed. Let's say you want to draw a border around element. Write XAML where your element is sandwiched with one or two
Border
elements. Yes, that's all. And the border should be auto-sized. This is my code sample on how to create a rounded "3D-style" auto-sized border:
sample for rounded corner combobox in wpf[
^].
Are you getting the idea? The approach has very little in common with Forms.
About things related to auto-sizing, you need to learn this:
http://msdn.microsoft.com/en-us/library/ms745058.aspx[
^].
Again, very different, isn't it? Are you finally getting convinced? You really need to lean things pretty much from scratch. If you keep asking questions like that, you will waste too much time.
—SA