当前位置: 首页 > news >正文

宝塔面板做网站绑定域名指数基金怎么选

宝塔面板做网站绑定域名,指数基金怎么选,百度代理公司怎么样,网站域名做链接怎么做以前在设置控件样式或自定义控件时#xff0c;都是使用触发器来进行样式更改。触发器可以在属性值发生更改时启动操作。 像这样#xff1a; Style TargetTypeListBoxItemSetter PropertyOpacity Value0.5 /Setter …以前在设置控件样式或自定义控件时都是使用触发器来进行样式更改。触发器可以在属性值发生更改时启动操作。 像这样 Style TargetTypeListBoxItemSetter PropertyOpacity Value0.5 /Setter PropertyMaxHeight Value75 /Style.TriggersTrigger PropertyIsSelected ValueTrueTrigger.SettersSetter PropertyOpacity Value1.0 //Trigger.Setters/Trigger/Style.Triggers/Style 还可以使用VisualState类来进行样式更改 VisualState类实现了可以让控件始终处于特定的状态的功能。例如当鼠标在控件的表面上移动时该控件被视为处于MouseOver状态。 没有特定状态的控件被视为处于 Normal 状态。 状态分为多个组前面提到的MouseMove状态和Normal属于 CommonStates 状态组(VisualStateGroup)。 大多数控件都有两个状态组CommonStates和 FocusStates。  在应用于控件的每个状态组中控件始终处于每个组的一种状态。但是控件不能处于同一组中的两种不同状态。 完整的状态可以参照下表 VisualState 名称VisualStateGroup 名称描述NormalCommonStates默认状态。MouseOverCommonStates鼠标指针悬停在控件上方。PressedCommonStates已按下控件。DisabledCommonStates已禁用控件。FocusedFocusStates控件有焦点。UnfocusedFocusStates控件没有焦点。 注意 1、VisaulState只适用于状态改变需要过渡动画的情况如果不想实现过渡效果推荐使用触发器。  2、如果要查找WPF附带控件可视状态(VisualState)的名称可参阅控件源码。(https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/controls/control-styles-and-templates) 下面我们使用VisualState类来自定义一个Button样式 1、使用Visual Studio 2019创建一个.Net Core WPF程序 2、在MainWindow中添加两个Button控件第一个button用于展示状态第二个button用于模拟控制第一个按钮的状态 1 Window x:ClassVisualStateDemo.MainWindow2 xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentation3 xmlns:xhttp://schemas.microsoft.com/winfx/2006/xaml4 xmlns:dhttp://schemas.microsoft.com/expression/blend/20085 xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/20066 xmlns:localclr-namespace:VisualStateDemo7 mc:Ignorabled8 TitleMainWindow Height450 Width800 9 StackPanel 10 Button Contentbutton1 HorizontalAlignmentCenter VerticalAlignmentCenter Width88 Height26 Namebtn/ 11 Button Contentbutton2(make button 1 to Pressed state) HorizontalAlignmentCenter VerticalAlignmentBottom Height26 Namebtn_2 Clickbtn_2_Click/ 12 /StackPanel 13 /Window 3、在Windows.Resources下定义样式如下 1 Window.Resources2 Style TargetType{x:Type Button}3 Setter PropertyBorderBrush ValueTransparent/4 Setter PropertyBackground ValueBlack/5 Setter PropertyForeground ValueWhite/6 7 Setter PropertyTemplate8 Setter.Value9 ControlTemplate TargetType{x:Type Button} 10 Border BorderThickness{TemplateBinding Border.BorderThickness} BorderBrush{TemplateBinding Border.BorderBrush} Background{TemplateBinding Panel.Background} Nameborder SnapsToDevicePixelsTrue CornerRadius5 11 VisualStateManager.VisualStateGroups 12 VisualStateGroup NameCommonStates 13 VisualState NameNormal 14 Storyboard 15 ColorAnimation Storyboard.TargetNameborder 16 Storyboard.TargetProperty(Border.Background).(SolidColorBrush.Color) 17 To{TemplateBinding Background} 18 Duration0:0:0.3/ 19 /Storyboard 20 /VisualState 21 VisualState NameMouseOver 22 Storyboard 23 ColorAnimation Storyboard.TargetNameborder 24 Storyboard.TargetProperty(Border.Background).(SolidColorBrush.Color) 25 ToSilver 26 Duration0:0:0.3/ 27 /Storyboard 28 /VisualState 29 VisualState NamePressed 30 Storyboard 31 ColorAnimation Storyboard.TargetNameborder Storyboard.TargetProperty(Border.Background).(SolidColorBrush.Color) To#7b8488 Duration0:0:0.3/ 32 /Storyboard 33 /VisualState 34 /VisualStateGroup 35 /VisualStateManager.VisualStateGroups 36 ContentPresenter RecognizesAccessKeyTrue Content{TemplateBinding ContentControl.Content} ContentTemplate{TemplateBinding ContentControl.ContentTemplate} ContentStringFormat{TemplateBinding ContentControl.ContentStringFormat} NamecontentPresenter Margin{TemplateBinding Control.Padding} HorizontalAlignment{TemplateBinding Control.HorizontalContentAlignment} VerticalAlignment{TemplateBinding Control.VerticalContentAlignment} SnapsToDevicePixels{TemplateBinding UIElement.SnapsToDevicePixels} FocusableFalse / 37 /Border 38 /ControlTemplate 39 /Setter.Value 40 /Setter 41 /Style 42 /Window.Resources 4、运行效果如下 5、使用代码控制VisualState 调用System.Windows.VisualStateManager.GoToState函数可以指定控件的状态。 在按钮2的单击事件中添加以下代码 1 private void btn_2_Click(object sender, RoutedEventArgs e) 2 { 3 System.Windows.VisualStateManager.GoToState(btn, Pressed, false); 4 } 如果是自定义控件直接将控件名换成this即可 1 System.Windows.VisualStateManager.GoToState(this, Pressed, false); 注意 如果在ControlTemplate中使用 VisualStateManager应该调用 GoToState 方法。 如果在ControlTemplate 外使用 VisualStateManager 例如如果在 UserControl 中或在单个元素中使用 VisualStateManager应该调用 GoToElementState 方法。 示例代码
http://www.w-s-a.com/news/46364/

相关文章:

  • 教做网站网站开发行业分析
  • 忻州网站建设培训友情链接交换形式有哪些
  • 佛山做外贸网站渠道外贸常用网站
  • 文章收录网站网站及新媒体建设办法
  • 招聘网站排行榜2021找建网站公司
  • 网站建设制作宝塔面板活动宣传推广的形式有哪些
  • 掉关键词网站敏捷软件开发流程
  • 微信小程序格泰网站建设新闻采编与制作专业简历
  • 电子商城建设网站海伦网站建设
  • 南充能够建设网站的公司有专门做设计的一个网站
  • 免费域名申请个人网站阿里巴巴运营的工作内容
  • 怎么建自己的手机网站保定电子商务网站建设
  • 系部网站建设中期检查表创建网站的公司
  • 西宁网站建设优化重庆企业的网站建设
  • 贝壳企业网站管理系统徽与章网站建设宗旨
  • 郑州网站模板动漫设计与制作设计课程
  • 在线制作网站的工具岳阳网站设计改版
  • 网站建设需要汇报哪些内容前端开发的工作内容
  • 无锡阿凡达网站建设美团app开发公司
  • 个性化企业网站制作公司深圳高端网站定制公
  • 专业深圳网站定制开发企业网站开发 流程
  • 网站建设推广的软文php网站平台
  • 如何做代刷网站长外贸网站个性设计
  • 合同网站开发 设计 后期维护如何搭建海外网络
  • 提供网站建设服务优化大师哪个好
  • 军队营房基础建设网站哦咪咖网站建设
  • fifa17做任务网站app下载免费安装
  • 网站开发用哪些技术seo是什么意思为什么要做seo
  • 网站会动的页面怎么做的与网站建设有关的招标文件
  • 公司网站如何做seowordpress付费资源