<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Programming with .NET - General</title><link>http://forums.silverlight.net/forums/17.aspx</link><description>General discussions around authoring Silverlight .NET applications.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: Resize TabControl with Page_SizeChanged Event.</title><link>http://forums.silverlight.net/forums/thread/144795.aspx</link><pubDate>Tue, 09 Dec 2008 15:53:54 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:144795</guid><dc:creator>NearDeath</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/144795.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=144795</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;Thanks, I will check that as well and see if I see anyting... If anyone else has any other ideas, let me know... :)</description></item><item><title>Re: Resize TabControl with Page_SizeChanged Event.</title><link>http://forums.silverlight.net/forums/thread/144443.aspx</link><pubDate>Mon, 08 Dec 2008 23:53:49 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:144443</guid><dc:creator>Bigsby</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/144443.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=144443</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;When the &amp;quot;filling&amp;quot; isn&amp;#39;t correct, add a breakpoint in this part of the code and check the running numbers. You&amp;#39;ll find there&amp;#39;s Panel derived class (probably a Grid) that is not returning the correct values.&lt;/p&gt;&lt;p&gt;These classes are yet long from clean in Silverlight. For instance, I&amp;#39;ve found some cases where the Grid control returns different sizes depending on having or not a Background set.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Resize TabControl with Page_SizeChanged Event.</title><link>http://forums.silverlight.net/forums/thread/144415.aspx</link><pubDate>Mon, 08 Dec 2008 22:47:23 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:144415</guid><dc:creator>NearDeath</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/144415.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=144415</wfw:commentRss><description>&lt;p&gt;All, I am having an issue getting my tabcontrol to resize when the web browser is resized. &lt;/p&gt;
&lt;p&gt;Here is the block of code doing the resizing... Basically what I am doing is calculating the percentage of screen change and then attempting to resize the control based on the percentage of screen change. If I don&amp;#39;t put in any specific code to do the resizing of the tab control, it resizes the the tab control border only, but none of the content therein gets resized, such as textboxes, labels, and tabs themselves. I&amp;nbsp;have a &amp;quot;UserControl&amp;quot; which has the tab control in it and I add the usercontrol to the root datagrid.&lt;/p&gt;
&lt;p&gt;Currently, the below code kind of works, but for some odd reason, the tab control does not size correctly with the page resize. When you shrink the page, the tabcontrol is shrinking a lot more than the rest of the page percentage wise, so that the tab control on full size looks correct, but when shrinking, it no longer fills up the screen and just takes up a small portion of the screen that is left. It almost looks like my mathmatics below is wrong, but it looks right to me.&lt;/p&gt;
&lt;p&gt;Any suggestions?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks ahead of time... Maurice&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (e.NewSize.Width &amp;lt; _originalWidth ||&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;e.NewSize.Height &amp;lt; _originalHeight)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;PageScale.ScaleX = 1.0;&lt;/p&gt;
&lt;p&gt;PageScale.ScaleY = 1.0;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;else&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (e.NewSize.Width / e.NewSize.Height &amp;gt; _originalAspectRatio)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;PageScale.ScaleY = 1.0;&lt;/p&gt;
&lt;p&gt;PageScale.ScaleX = 1.0;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;else&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;PageScale.ScaleX = e.NewSize.Width / _originalWidth;&lt;/p&gt;
&lt;p&gt;PageScale.ScaleY = e.NewSize.Height / _originalHeight;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;double&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dbl_widthDifference = _originalWidth - e.NewSize.Width;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;double&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dbl_heightDifference = _originalHeight - e.NewSize.Height;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;double&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dbl_widthPercent = dbl_widthDifference / _originalWidth;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;double&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dbl_heightPercent = dbl_heightDifference / _originalHeight;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;double&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dbl_finalWidth = 1.0 - dbl_widthPercent;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;double&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dbl_finalHeight = 1.0 - dbl_heightPercent;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;cntrlScaleTransform.ScaleX = dbl_finalWidth;&lt;/p&gt;
&lt;p&gt;cntrlScaleTransform.ScaleY = dbl_finalHeight;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;m_tabCntrlMainContent.RenderTransform = cntrlScaleTransform;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>