Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when I apply animation(LeftPanelMouseEnter),text of selected button is getting cut but I want second word is come under first.
private void LeftPanelMouseEnter(object sender, MouseEventArgs e)
       {
           if (resizeFlag == false && pinFlag == false && LeftPanel.Width==24 )
           {
               this.RegisterName(LeftPanel.Name, LeftPanel);
               DoubleAnimation dbani = new DoubleAnimation();
               dbani.From = 24;
               dbani.To = LeftPanelMaxWidth;
               dbani.Duration = new Duration(TimeSpan.FromSeconds(.7));
               Storyboard.SetTargetName(dbani, LeftPanel.Name);
               Storyboard.SetTargetProperty(dbani, new PropertyPath(Border.WidthProperty));
               Storyboard myWidthAnimatedButtonStoryboard = new Storyboard();
               myWidthAnimatedButtonStoryboard.Children.Add(dbani);
               myWidthAnimatedButtonStoryboard.Begin(LeftPanel);
               mySidebarControl.Visibility = Visibility.Visible;
               borderSelectedButton.Visibility = Visibility.Visible;
               scrolviewerRelatedButtons.Visibility = Visibility.Visible;
               gridMainButtons.Visibility = Visibility.Visible;
               logoPanel.Visibility = Visibility.Visible;
               resizeFlag = true;
               pinButton.ToolTip = Properties.Resources.TOOL_TIP_PINUP_BUTTON_UNCHECKED;
               scrolviewerRelatedButtons.Margin = new Thickness(24, 0, 0, 0);
               pinDockPanel.Margin = new Thickness(24, 0, 0, 0);
               selectedButton.Margin = new Thickness(24, 0, 0, 0);
               diagnosisButton.Margin = new Thickness(24, 0, 0, 0);
               firmwareButton.Margin = new Thickness(24, 0, 0, 0);
               readerSettingButton.Margin = new Thickness(24, 0, 0, 0);
               logoPanel.Margin = new Thickness(24, 0, 0, 0);
               mySidebarControl.myNavigationPaneButton.Background = (Brush)FindResource("MySelectedButtonOrangeGradientBrush");
               mySidebarControl.myNavigationPaneButton.Foreground = System.Windows.Media.Brushes.Black;
               mySidebarControl.applicationborder.BorderBrush = (Brush)FindResource("MySelectedButtonOrangeGradientBrush");
           }
           flag1 = false;

       }
Posted
Updated 20-Sep-11 0:41am
v2
Comments
Herman<T>.Instance 20-Sep-11 6:46am    
perhaps an example would tell more

1 solution

just guessing ... you have:
HTML
<button content="two words" />
and it's cut. Instead do:
HTML
<button>
   <textblock text="two words" textwrapping="Wrap" />
</Button></button>
and it will be wrapped.

Cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900