摘要:1、效果图:2、XAML ...
阅读全文
随笔分类 - .net之WPF
WPF页面开发点滴
摘要:1、效果图:2、XAML ...
阅读全文
摘要:m_Element.Fill = SystemColors.WindowBrush;BorderBrush="{x:Static SystemColors.WindowBrush}"
阅读全文
摘要:做了一个自定义控件和一个自定义Grid,里面的元素可以随着绑定属性变化:效果图(一定滑块):关键代码:1、自定义属性代码: public class MyGrid : Grid { public static readonly DependencyProperty ColumnCountProperty = DependencyProperty.Register("ColumnCount", typeof(int), typeof(MyGrid), new FrameworkPropertyMetadata((int)1,FrameworkPr...
阅读全文
摘要:效果图:下载:Code参考:http://www.codeproject.com/Articles/33001/WPF-A-Simple-Color-Picker-With-Previewhttp://www.codeproject.com/Articles/229442/WPF-Color-Pic...
阅读全文
摘要:调用方法: ReturnObject loadReturnObject = WaitingWindow.Show("正在加载", aBO, "GetA", new Object[] { "", "", "", "", m_IteratorValues, false }) as ReturnObject;下载:Code
阅读全文
摘要:iPad塔防的防守兵的效果很炫,2个小时用WPF模拟了一个。效果图:关键代码: <Grid> <Grid.Background> <ImageBrush ImageSource="Koala.jpg"/> </Grid.Background> <Button Content="Button1" HorizontalAlignment="Left" Margin="187,107,0,0" VerticalAlignment="Top" Wid
阅读全文
摘要:参考:http://code.msdn.microsoft.com/WPF-Autocomplete-Textbox-df2f1791#content问题:1、获得焦点时,不自动搜索2、按向下的箭头时,不自动到下拉项3、输入中文,挡住输入框针对这几个问题,做了控件的修改,1、获得焦点时,添加GotF...
阅读全文
摘要:最近看一个帖子,做不规则按钮,写的非常好。超链接:http://blog.csdn.net/cmis7645/article/details/7592372#comments效果图:代码:View Code 代码不是很难理解,关键是P...
阅读全文
摘要:效果图:用于提示用户的输入代码:Code
阅读全文
摘要:把图片生成资源,怎么在后台访问困扰了我几天,在网上也查了很多例子,各种说法都有如:m_Image.Source = new BitmapImage(new Uri(@"Resources/Images/more.png", UriKind.Relative));但是在实际进行过程中,访问不到。经过测试,很简单就能访问到了:Code:m_Image.Source = new BitmapImage(new Uri("Images/more.png", UriKind.Relative));上两级文件夹:m_Image.Source = new Bitmap
阅读全文
摘要:WPF调用WinForm中的 OpenFileDialog 和 FolderBrowserDialog 来实现响应的功能 OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Title = "选择文件"; openFileDialog.Filter = "zip文件|*.zip|rar文件|*.rar|所有文件|*.*"; openFileDialog.FileName = string.Empty; openFileDi...
阅读全文
摘要:0、更改模板效果:代码: ...
阅读全文
摘要:http://code.msdn.microsoft.com/windowsdesktop/Dynamic-Image-Button-in-WPF-caec28b7#content
阅读全文
摘要:在WPF中设计登录窗口关闭时打开主窗口,自动生成的App.xaml不能满足要求,1、把App.xaml的属性窗口中的生成操作设定为 无2、添加Program类 static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { LoginWindow loginForm = new LoginWindow(); ...
阅读全文
摘要:WPF和Silverlight环境下KeyDown和KeyUp的本身不同,其中KeyDown不响应一些功能键,而KeyUp响应。
阅读全文
摘要:今天做WPF项目,遇到添加引用后,在代码中找不到引用,原来项目的目标框架为.NET Framework 4 Client Profile,把框架改为.NET Framework 4,编译通过
阅读全文
摘要:枚举m_Theme.HorizontalAlignment = (HorizontalAlignment)Enum.Parse(typeof(HorizontalAlignment), m_HorizontalAlignment);结构m_Theme.FontWeight = (FontWeight)System.ComponentModel.TypeDescriptor.GetConverter(typeof(FontWeight)).ConvertFromString(m_FontWeightName);
阅读全文
|