Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does design time and runtime size differ?
Message
From
28/10/2009 02:19:31
 
 
To
28/10/2009 00:45:34
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:
01431825
Views:
40
Thanks. I will certainly lookup those links.

Later. Those links were great, especially the series Josh does on "A Guided Tour of WPF". It explains in clear language how objects are put together in a WPF app and was very illuminating.

>>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.
>
>No, I'm not all that experienced in WPF. I just started looking at it a few weeks ago. For example, I don't know why sometimes VS is generating Width or Height settings and sometimes it isn't. I could only tell what was happening to your Form from looking at your XAML, and then it was obvious to me.
>
>But, anyway, keep plugging along. I kind of set it aside for now (not because I couldn't get my head around it, but because I got side-tracked by something else I need to know more about ... WCF).
>BTW, I've suggested this before to others and you might want to take a look if you haven't already. Josh Smith has some good stuff on his website as it pertains to WPF and the MVVM pattern; which seems to be *the* way to go when using WPF (and Silverlight too, I think):
>
>http://joshsmithonwpf.wordpress.com/category/mvvm/
>http://joshsmithonwpf.wordpress.com/a-guided-tour-of-wpf/
>http://joshsmithonwpf.wordpress.com/category/praxis/
>http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
>
>I'm sure I could find more, but the above are a few I've used for learning and for reference. I like Josh's writing, coding and his ability to make it all fairly understandable.
>
>~~Bonnie
>
>
>
>
>>>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