Trouble with Anchor
I am programming VS 2005 for window mobile 2005 w/ the vga smart phone emulator. I dynamically create a Label l. I add it to an Array of Label ls, and the controls collection of the form. If, I anchor it Left it displays on the form, but if I anchor it to the right it is moved off the display area. If I do not anchor it, the right side list box displays fine.
Is this a bug? If I comment out the bold line below it displays fine. But it is not anchored.
if(i % 2 == 0) { pb.Left =ConfigurationHelper.IconSidePadding; l.TextAlign =ContentAlignment.TopLeft; ls[ i ].Anchor =AnchorStyles.Left |AnchorStyles.Top; } else { pb.Left =this.Width - pb.Width -ConfigurationHelper.IconSidePadding; l.TextAlign =ContentAlignment.TopRight; ls[ i ].Anchor =AnchorStyles.Right|AnchorStyles.Top; } |
Also if i set the anchor of l it behaves differnetly than if I set ls[ i ]. What are the refference differences in CF. I though if I assign ls[ i ]=l that i could set properties of either and they would work the same. But I keep recreating l and it looks like some properties assigned to l are lost. Why? Is there a discription some where?

