Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does design time and runtime size differ?
Message
From
27/10/2009 21:57:07
 
 
To
27/10/2009 21:06:35
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01431413
Message ID:
01431811
Views:
51
>Bernard,
>
>Your ComboBox has not shrunk. If you look carefully at your screenshots, you'll see that the left side of your two windows (IDE vs Runtime) are not lined up (look at the left edges of the TextBox and ComboBox). If you line up those left TextBox and ComboBox edges, I'm 99.999% sure that the right edges of the ComboBox in the two windows will be lined up.
>
>It's the TextBox that has grown ... and that is because the TextBox does *not* have a Width specified, whereas you *have* specified a Width for the Combo. Ditto for the Buttons. Your top button has a Height specfied, whereas your bottom button does not ... that's why your bottom button has grown in height.
>
>It's all very logical if you examine it closely.
>
>~~Bonnie


Bonnie

Now that you mention it, it is the text box that has grown.

>It's all very logical if you examine it closely.

Maybe for you, but I am just a newbie at WPF so it will not make sense. However now you mention it. I can see what is happening. It is just that I did not set any width for any controls. I just moved them about. VS generated that code all on its own and did not tell me that it was setting a width property for one control I moved and not for another. How odd. Is there no consistent way to get objects to align? I don't want to have to type in XAML. I want to do it visually.

Since you are experienced with WPF you know what is happening. I will do some more testing and observer the changes in XAML that VS generates.

Another odd thing. A pal on another forum recreated my sample form (1 textbox, 1 button) and on his computer, running Vista, the runtime and design time was EXACTLY the same. When I downloaded and ran his project on my XP machine, the button had GROWN in runtime. Note that the code is exactly the same. Only the OS has changed. So this means that for every control I will have to have different settings for XP, Vista and maybe Windows 7?

This is almost like the browser rendering problems we have with pages designed for IE and Firefox separately.

This is even worse than I thought at first.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform