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

网站建设费用怎么算乐清网站建设乐清网站设计

网站建设费用怎么算,乐清网站建设乐清网站设计,深圳营销型网站费用,小吃培训网站源码原文:WPF遍历当前容器中某种控件的方法版权声明#xff1a;本文为博主原创文章#xff0c;未经博主允许不得转载。 https://blog.csdn.net/m0_37591671/article/details/79528845 WPF遍历当前容器中某种控件的方法 WPF遍历当前容器中某种控件的方法1.目的#xff1a;2.实现思…原文:WPF遍历当前容器中某种控件的方法 版权声明本文为博主原创文章未经博主允许不得转载。 https://blog.csdn.net/m0_37591671/article/details/79528845 WPF遍历当前容器中某种控件的方法 WPF遍历当前容器中某种控件的方法1.目的2.实现思路 1.目的 在设计界面的时候遇到了这样一个问题一个窗口中有六个按钮我希望点击某一个按钮的时候该按钮能够高亮显示即更换该按钮的背景图片点击第二个的时候第二个高亮显示其他按钮还是显示为普通按钮颜色如图 2.实现思路 2.1 在每一次点击的时候遍历当前容器中所有Button但是我们这里只需要下面六个然后根据按钮的名称来依次给按钮背景图片赋予相应的路径即还原到普通普片的路径在给点击的按钮背景图片赋予高亮图片的路径。 2.2 还原到普通普片的路径 //还原到普通普片的路径public static void BackToUsedPicture(UIElement uIElement){//遍历当前容器中所有ButtonListButton btnListFindChirldHelper.FindVisualChildButton(uIElement);foreach (var item in btnList){Image img new Image();if (item.Name Weather_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/weatherBUTTON.jpg, UriKind.Relative)); }else if (item.Name Temperature_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/temperatureBUTTON.jpg, UriKind.Relative));}else if (item.Name Vibration_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/virbrationBUTTON.jpg, UriKind.Relative));}else if (item.Name Stress_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/stressBUTTON.jpg, UriKind.Relative));}else if (item.Name Deformation_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/DeformationBUTTON.jpg, UriKind.Relative));}else if (item.Name Pedestria_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/peopleBUTTON.jpg, UriKind.Relative));}item.Content img;} } 2.3 寻找当前容器中某种控件的 方法 public static class FindChirldHelper{public static ListT FindVisualChildT(DependencyObject obj) where T : DependencyObject{try{ListT TList new ListT { };for (int i 0; i VisualTreeHelper.GetChildrenCount(obj); i){DependencyObject child VisualTreeHelper.GetChild(obj, i);if (child ! null child is T){TList.Add((T)child);ListT childOfChildren FindVisualChildT(child);if (childOfChildren ! null){TList.AddRange(childOfChildren);}}else{ListT childOfChildren FindVisualChildT(child);if (childOfChildren ! null){TList.AddRange(childOfChildren);}}}return TList;}catch (Exception ee){MessageBox.Show(ee.Message);return null;}}} 3.3 上端使用 private void Weather_btn_Click(object sender, RoutedEventArgs e){ ChangeButtonToLight((Button)sender);}public void ChangeButtonToLight(Button button){ChangeButtonImage.BackToUsedPicture(this);Image img new Image();if (button.Name Weather_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/weatherBUTTONLight.png, UriKind.Relative));}else if (button.Name Temperature_btn){img.Source new BitmapImage(new Uri(../../images/MonitorData/temperatureBUTTONLight.png, UriKind.Relative));}else if (button.Name Vibration_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/virbrationBUTTON.jpg, UriKind.Relative));}else if (button.Name Stress_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/stressBUTTON.jpg, UriKind.Relative));}else if (button.Name Deformation_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/DeformationBUTTON.jpg, UriKind.Relative));}else if (button.Name Pedestria_btn){img.Source new BitmapImage(new Uri(../../Images/MonitorData/peopleBUTTON.jpg, UriKind.Relative));}button.Content img;}
http://www.yutouwan.com/news/453558/

相关文章:

  • 枣庄定制网站建设制作什邡移动网站建设
  • 网站建设的技术方案怎么建一个小说网站
  • 唯美音乐图文网站建设麻涌企业网站建设
  • 公司网站建设岗位做天猫网站设计难吗
  • 建设信息发布功能的网站东莞网站设计行情
  • 微信网站设计运营石家庄建立网站
  • 厦门比较好的网站设计公司响应式网站教程
  • 四字母net做网站怎么样网站上的视频上传怎么做
  • 做添加剂的外贸网站有哪些网站优化推广培训
  • 常平网站建设ppt模板网站下载
  • 我自己怎么建网站什么是网络营销促销?网络营销促销有何作用?
  • 怎样建设一个网站常州房地产网站建设
  • 网站已经备案更换主机网站建设有关数据库的代码
  • 深圳网站开发学习商务网站建设论文答辩ppt
  • 白云鄂博矿网站建设建网站需要什么知识
  • 南京电器网站建设作品集怎么做网页
  • 教育门户网站设计欣赏网站pv uv统计
  • 途牛网站建设天津+交友+网站建设
  • 开封网站建设报价网络营销的专业知识
  • 临汾网站建设电话设计在线设计网站
  • 网站内页权重怎么查广东建设厅官网证书查询
  • 营销平台网站建设网站后天添加文章不显示
  • 网站打开慢是什么原因wordpress 做图片
  • 广州黄埔做网站免费h5源码资源源码站
  • 企业网站建设可以分为个人网站模板素材下载
  • 网站开发需求列表网站上怎么做星星评分
  • dw中做网站的步骤个人网站做的类型
  • 公司网站的服务器网站管理建设落实报告
  • 重庆网站建设技术托管wordpress文章中加入代码
  • 如何在服务器上做网站网站建设与代运营介绍