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

永嘉网站建设汽车精品设计网站建设

永嘉网站建设,汽车精品设计网站建设,网站开发会什么软件,会展网站建设成功的原因这种应用场景其实很多#xff0c;比如游戏中装备/魔法的选择菜单#xff0c;这里借用了深蓝色右手的一张图 再比如聊天室中的文本颜色设置 虽然sl的ToolTipService.ToolTip属性可以设置任何对象#xff0c;比如下面这样 代码 1 Rectangle FillRed比如游戏中装备/魔法的选择菜单这里借用了深蓝色右手的一张图  再比如聊天室中的文本颜色设置  虽然sl的ToolTipService.ToolTip属性可以设置任何对象比如下面这样 代码 1 Rectangle FillRed Height50 Width50 ToolTipService.PlacementTop2             ToolTipService.ToolTip3                 StackPanel OrientationHorizontal4                     Rectangle FillGreen Height50 Width50/Rectangle5                     Rectangle FillBlue Height50 Width50 Margin1,0,0,0/Rectangle6                     Rectangle FillPink Height50 Width50 Margin1,0,0,0/Rectangle7                 /StackPanel8             /ToolTipService.ToolTip           9         /Rectangle  但是有一个问题鼠标一旦离开对象tooltip就消失了没办法在tooltip工具栏上点选操作。  所以得换一种思路可以借助VSM方便的实现设置好tooltip工具条后定义二个基本的状态Enter Leave 即可Enter状态中设置tooltip对应的对象显示Leave状态中设置tooltip对象隐藏示例代码(Xaml) 代码 UserControl    xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentation     xmlns:xhttp://schemas.microsoft.com/winfx/2006/xaml    xmlns:dhttp://schemas.microsoft.com/expression/blend/2008 xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006     mc:Ignorabled    x:ClasstooltipTest.MainPage    d:DesignWidth640 d:DesignHeight480    Grid x:NameLayoutRoot        !--视觉状态定义区--        VisualStateManager.VisualStateGroups            VisualStateGroup x:NameCommStates                VisualState x:NameEnter                    Storyboard                        ObjectAnimationUsingKeyFrames BeginTime00:00:00 Storyboard.TargetNameitemsTip Storyboard.TargetProperty(UIElement.Visibility)                            DiscreteObjectKeyFrame KeyTime00:00:00                                DiscreteObjectKeyFrame.Value                                    VisibilityVisible/Visibility                                /DiscreteObjectKeyFrame.Value                            /DiscreteObjectKeyFrame                        /ObjectAnimationUsingKeyFrames                    /Storyboard                /VisualState                VisualState x:NameLeave                    Storyboard                        ObjectAnimationUsingKeyFrames BeginTime00:00:00 Storyboard.TargetNameitemsTip Storyboard.TargetProperty(UIElement.Visibility)                            DiscreteObjectKeyFrame KeyTime00:00:00.1                                DiscreteObjectKeyFrame.Value                                    VisibilityCollapsed/Visibility                                /DiscreteObjectKeyFrame.Value                            /DiscreteObjectKeyFrame                        /ObjectAnimationUsingKeyFrames                    /Storyboard                /VisualState            /VisualStateGroup        /VisualStateManager.VisualStateGroups        Canvas HorizontalAlignmentCenter VerticalAlignmentCenter x:NamecTip Height20 Width20 CursorHand MouseLeaveGoToLeave MouseEnterGoToEnter            Rectangle x:NamerColor FillBlack Width20 Height20 ToolTipService.ToolTip选择颜色/            !--tip显示区--            ItemsControl x:NameitemsTip Canvas.Top-21 Canvas.Left0 VisibilityCollapsed                ItemsControl.ItemsPanel                    ItemsPanelTemplate                        StackPanel OrientationHorizontal/                    /ItemsPanelTemplate                /ItemsControl.ItemsPanel                ItemsControl.ItemTemplate                    DataTemplate                        Rectangle Fill{Binding Color} ToolTipService.ToolTip{Binding Name} Width20 Height20 Margin0,0,1,0 MouseLeftButtonDownChangeColor/                    /DataTemplate                /ItemsControl.ItemTemplate            /ItemsControl        /Canvas            /Grid/UserControl 后端代码 代码 using System.Collections.Generic;using System.Windows;using System.Windows.Controls;using System.Windows.Input;using System.Windows.Media;using System.Windows.Shapes;namespace tooltipTest{    public partial class MainPage : UserControl    {        ListFillColor lstTipsData;        public MainPage()        {            InitializeComponent();            //初始化数据            lstTipsData  new ListFillColor() {                 new FillColor(){ Color  new SolidColorBrush(Colors.Red), Name红色},                new FillColor(){ Color  new SolidColorBrush(Colors.Blue), Name蓝色},                new FillColor(){ Color  new SolidColorBrush(Colors.Green),Name绿色},                new FillColor(){ Color  new SolidColorBrush(Colors.Magenta), Name洋红},                new FillColor(){ Color  new SolidColorBrush(Colors.Black), Name黑色},                new FillColor(){ Color  new SolidColorBrush(Colors.Orange), Name橙色},            };            this.Loaded  new RoutedEventHandler(MainPage_Loaded);        }        void MainPage_Loaded(object sender, RoutedEventArgs e)        {            itemsTip.ItemsSource  lstTipsData; //数据绑定                   }        private void GoToEnter(object sender, MouseEventArgs e)        {            VisualStateManager.GoToState(this, Enter, false);        }        private void GoToLeave(object sender, MouseEventArgs e)        {            VisualStateManager.GoToState(this, Leave, false);        }        /// summary        /// 点击后更换颜色        /// /summary        /// param namesender/param        /// param namee/param        private void ChangeColor(object sender, MouseButtonEventArgs e)        {            rColor.Fill  (sender as Rectangle).Fill;            VisualStateManager.GoToState(this, Leave, false);        }    }    /// summary    /// 测试实体类    /// /summary    public class FillColor    {        public SolidColorBrush Color { set; get; }        public string Name { set; get; }    }}    转载于:https://www.cnblogs.com/yjmyzz/archive/2009/12/12/1622697.html
http://www.zqtcl.cn/news/548895/

相关文章:

  • wordpress全站背景音乐中山网站搜索排名
  • 搭建网站的过程透明主题wordpress
  • 丰台网站建设公司电话深圳微信商城网站设计公司
  • 做淘宝要用的网站吗上海微信网站
  • 佛山高端网站制作公司wordpress 发送邮件插件
  • 类似站酷的设计类网站网站建设需要待摊吗
  • 用php做视频网站在学做网站还不知道买什么好
  • wordpress培训类网站网站建设 好
  • 网站开发需要2个月吗网站建设案例精粹
  • 网站建设项目职责营销型网站建设五大内容
  • 建设工程监理招标网站W做网站
  • 网站建设与维护教学课件网站上线前做环境部署
  • 信誉好的网站建设做网站成为首富的外国人
  • 常州网站制作市场湖北省荆门市城乡建设网站
  • 泉州网站制作运营商专业北京软件公司招聘信息查询
  • 车床加工东莞网站建设网站建设教学改进
  • 深圳专业做网站建设西安网站建设有限公司
  • wordpress 一键建站wordpress子主题style
  • 昆明设计网站怎么做网络广告
  • 2018什么做网站深圳企业网站设
  • 北京旅游外贸网站建设博客集成wordpress
  • 中国最好的建设网站哪些网站教你做系统
  • 自己做网站别人怎么看见网站建设办公
  • 凡科做网站视频网站哪家好
  • 查询网站是否正规营销策略国内外文献综述
  • 做网页用的网站wordpress用户角色权限管理
  • 怎么查网站备案的公司wordpress 无刷新评论
  • 学前心理学课程建设网站百度极速版下载
  • 佛山做营销型网站建设深圳宝安区租房
  • 做汽车团购的网站建设营销方案有哪些