摘要: <Window.Resources> <DataTemplate x:Key="ItemTemplate"> <TextBlock Text="{Binding}" Foreground="Red" /> </DataTemplate> <DataTemplate x:Key="SelectedTemplate"> <TextBlock Text="{Binding}" Foreground="White" / 阅读全文
posted @ 2011-06-01 11:22 .net万剑 阅读(873) 评论(0) 推荐(0) 编辑
摘要: 添加命名空间:using System.Windows.Forms;using System.Drawing;随后引用一个Dll : C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll现在我们就能直接使用winform的调色板控件了。 ColorDialog colorDialog = new ColorDialog(); colorDialog.AllowFullOpen = true; colorDialog.ShowDialog(); System.Windows.Media.SolidColorBrush s 阅读全文
posted @ 2011-05-30 10:55 .net万剑 阅读(3189) 评论(0) 推荐(2) 编辑
摘要: 第一种方法:直接在Page或frame加载页面 Click here 第二种方法:调用系统浏览器加载指定页面 Click here privatevoid Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e){ Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); e.Handled =true;} 阅读全文
posted @ 2011-05-30 09:26 .net万剑 阅读(4976) 评论(2) 推荐(1) 编辑
摘要: 1 CheckBox cbSelect = (CheckBox)(ListBoxView.Items[i] as ListBoxItem).Template.FindName("cbSelect", ListBoxView.Items[i] as ListBoxItem);2 TextBlock textblackConnPointNum = (TextBlock)(ListBoxView.Items[i] as ListBoxItem).Template.FindName("textblackConnPointNum", ListBoxView.Ite 阅读全文
posted @ 2011-05-24 12:41 .net万剑 阅读(13146) 评论(0) 推荐(2) 编辑
摘要: WPF 和WinForm的MeeageBox不同View Code if(MessageBox.Show("内容", "标题", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes){} 阅读全文
posted @ 2011-05-10 10:03 .net万剑 阅读(5406) 评论(0) 推荐(1) 编辑
摘要: View Code 对于强制转换,先举几个例字说明:1、long longType = 100;int intType = longType;// 错误,需要使用显式强制转换int intType = (int)longType;//正确,使用了显式强制转换2、string stringType = "12345";int intType = (int)stringType;//错误,string类型不能直接转换为int类型int intType = Int32.Parse(stringType);//正确3、long longType = 100;string strin 阅读全文
posted @ 2011-04-27 20:10 .net万剑 阅读(793) 评论(0) 推荐(0) 编辑
摘要: 在工作中,我们经常需要用到图标素材。你也许能搜到很多的图标资源网站,但要找到免费的高质量图标却很难,这就是为什么我今天要与大家分享这些优秀的免费质量图标搜索引擎,相信在这些网站你能找到你要的东西。如果你知道更多更好的网站,欢迎与我们分享!FindIconsFindIcons 是我最喜欢的图标搜索引擎,目前已拥有超过 300,000 个图标资源。IconFinderIconfinder 能帮助你快速找到需要的高质量图标,目前已拥有超过 150,000 个图标资源。MrIconsMrIcons 也是非常不错的图标搜索引擎,拥有 125,174 个图标资源。IconletIconlet 是一个查找. 阅读全文
posted @ 2011-04-16 08:37 .net万剑 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 后台代码: 1 private static bool boolean = true; 2 3 public static bool Boolean 4 { 5 get { return MainWindow.boolean; } 6 set { MainWindow.boolean = value; } 7 } 8 9 private void errorBtn_Click(object sender, RoutedEventArgs e)10 {11 dialogWindow.Title = "Error";12 dialogWindow = new DialogWin 阅读全文
posted @ 2011-04-15 19:49 .net万剑 阅读(1654) 评论(0) 推荐(0) 编辑
摘要: 1 <Button Style="{DynamicResource DefalutButton}" FocusVisualStyle="{x:Null}" Height="21" Tag="111" Width="49" Canvas.Left="72" Canvas.Top="172" HorizontalAlignment="Left" Margin="2.333,60,0,0" VerticalAlign 阅读全文
posted @ 2011-04-07 16:05 .net万剑 阅读(4233) 评论(0) 推荐(0) 编辑
摘要: 颜色样式: 1 <LinearGradientBrush x:Key="MenuPopupBrush" 2 EndPoint="0.5,1" 3 StartPoint="0.5,0"> 4 <GradientStop Color="#7FFFFFFF" 5 Offset="0" /> 6 <GradientStop Color="#C28B008B" 7 Offset="0.3"/> 8 <GradientStop 阅读全文
posted @ 2011-04-06 11:39 .net万剑 阅读(4665) 评论(2) 推荐(2) 编辑