Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

How do you set a default size of a control that you can resize?


  • Please log in to reply
No replies to this topic

#1 XARZU

XARZU

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Local time:07:20 PM

Posted 06 January 2012 - 05:14 PM

How do you set a default size of a control that you can resize?

I have been looking at a code sample from Charles Petzold.

It is from here:

http://www.charlespetzold.com/blog/2009/05/Realizing-a-Fisheye-Effect-in-Silverlight.html
it uses mouse over methods to increase the size of button classes.

I have it working but I want to make some modifications. I want the starting size of the button to be larger. I do not know how much of the code I need to post here to make the issue clear enough. The XAML for the page describes a "FisheyeButton" that is described in a seperate xaml file. Something like this:

<StackPanel x:Name="LayoutRoot" Width="1017" Orientation="Horizontal" Height="253">   
    <src:FisheyeButton Style="{StaticResource btnStyle}" ButtonContent="Button No. 1" />   
</StackPanel>


The functionality of the project is such that if I give the Fisheyebutton a width and height a set size at this loction, the effect where the size of the control the effect of becoming larger does not happen. In other words, if I write in the <src:FisheyeButton... tag above Width="100", then the button does not behave at run time as it should.

In the same page.xaml file, the btnStyle is defined like this:


<UserControl.Resources >
   <Style x:Key="btnStyle" TargetType="src:FisheyeButton">
      <Setter Property="VerticalAlignment" Value ="Center" />
      <Setter Property="HorizontalAlignment" Value ="Center" />
      <Setter Property="FontSize" Value ="12" />
   </Style >
</UserControl.Resources >

I wonder if perhaps at this point, I can add a "Setter" property to define a default starting widh and height for the class.

BC AdBot (Login to Remove)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users