如何管理鼠标上的selectedbutton的文本在动画中输入 [英] how to manage the text of selectedbutton on mouseEnter in animation

查看:83
本文介绍了如何管理鼠标上的selectedbutton的文本在动画中输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我应用动画(LeftPanelMouseEnter)时,所选按钮的文本被剪切,但我想第二个单词排在第一位.

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;

       }

推荐答案

只是猜测...您已经:
just guessing ... you have:
<button content="two words" />

并剪切.而是:

<button>
   <textblock text="two words" textwrapping="Wrap" />
</Button></button>

它将被包裹.

干杯

and it will be wrapped.

Cheers


这篇关于如何管理鼠标上的selectedbutton的文本在动画中输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆