work hard work smart

专注于Java后端开发。 不断总结,举一反三。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  B.WPF 控件开发

摘要:Expander 的使用缩小为原来的0.8倍 <Expander Header="ExpanderName" FontSize="16"> <Expander.RenderTransform> <ScaleTransform ScaleX=".8" ScaleY=".8"></ScaleTransform> </Expander.RenderTransform> </Expander> 阅读全文

posted @ 2011-12-26 14:24 work hard work smart 阅读(597) 评论(0) 推荐(0)

摘要:<Window x:Class="WPFPopup.RuntimePopup" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="RuntimePopup" Height="800" Width="800" Loaded="Window_Loaded&quo 阅读全文

posted @ 2011-12-26 14:23 work hard work smart 阅读(14815) 评论(0) 推荐(0)

摘要:WPF TranslateTransform的使用1、水平移动2、单击后向X,Y移动15<Canvas x:Class="ControlTest2.TranslateTransformDemon.TranslateTransformInCanvas" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300&quo 阅读全文

posted @ 2011-11-23 14:55 work hard work smart 阅读(8290) 评论(0) 推荐(1)

摘要:下面是ComboBox的简单实用XAML: <Grid> <ComboBox Height="23" Margin="12,12,0,0" Name="comboBox1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="120" /> <Button Height="23" Margin="21,53,69,0" Name="b 阅读全文

posted @ 2011-11-23 10:38 work hard work smart 阅读(7435) 评论(0) 推荐(0)

摘要:1、WPF 使用Code创建Canvas2、WPF 使用Code创建StackPanel3 WPF 使用Code创建DockPanel4 WPF 使用Code创建Grid其它的控件还有Border,UniformGrid,ViewBox,WrapPanel等原理都是一样的。略. 阅读全文

posted @ 2011-11-15 10:53 work hard work smart 阅读(1123) 评论(0) 推荐(1)

摘要:1、不同于Windows Forms,当前WPF版本没有提供一个直接的方法可以把TreeView控件所有的节点都展开。一般来说,在WPF中有两种方法可以实现这个功能。第一种方法就像下面例子一样使用样式展开所有节点:<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="ControlTest2.TreeViewTest&q 阅读全文

posted @ 2011-11-14 15:45 work hard work smart 阅读(3756) 评论(1) 推荐(1)

摘要:WPF没有像ASP.NET提供一个RadioButtonList的控件。幸运的是,我们可以利用WPF样式和模板的强大功能,用纯粹的XAML代码实现这个功能<Window x:Class="ControlTest2.ListBoxTest2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespa 阅读全文

posted @ 2011-11-14 15:45 work hard work smart 阅读(3863) 评论(0) 推荐(0)

摘要:Button 透明效果<Window x:Class="ControlTest2.ButtonGlassTest" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="ButtonGlassTest" Height="480" Width="640"> <W 阅读全文

posted @ 2011-11-08 14:49 work hard work smart 阅读(10354) 评论(3) 推荐(0)

摘要:一、ListBox系列索引1、WPF ListBox基础(包括ListBox多列展示,ListBox实现分页效果,ListBox绑定XML数据源)2、ListBox 单击变大动画效果(使用模板、样式、绑定数据源等)二、ListBox 单击变大动画效果(使用模板、样式、绑定数据源等) <Grid> <ListBox x:Name="_listBox" ItemsSource="{StaticResource DataSource}" ItemContainerStyle="{StaticResource ListBoxItemS 阅读全文

posted @ 2011-09-06 22:13 work hard work smart 阅读(3556) 评论(0) 推荐(2)

摘要:1.你要旋转控件角度的话,可以设置其RenderTransform或是LayoutTransform属性,然后为其设置一个RotateTransform实例,并且设置Angle属性。<StackPanel><Slider Value="0" Name="slider" Minimum="0" Maximum="360" /><Button Content="Button" Width="120" Height="30"> 阅读全文

posted @ 2011-08-11 16:36 work hard work smart 阅读(8634) 评论(0) 推荐(1)