WPF一个简单的分页控件
来源:互联网 发布:steam网络不稳定 编辑:程序博客网 时间:2024/05/16 02:11
WPF一个简单的分页控件,如图1。
图1
创建用户控件PageControl.xaml。
<UserControl x:Class="Simple.Calculator.WinForm.Common.PageControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" > <UserControl.Resources> <!--框样式--> <Style TargetType="{x:Type Border}" x:Key="gBox"> <Setter Property="BorderBrush" Value="CornflowerBlue"/> <Setter Property="Background" Value="#dfe6ec"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="CornerRadius" Value="2"/> <Setter Property="Padding" Value="5"/> </Style> <!--公共按钮--> <Style TargetType="{x:Type Button}" x:Key="gmButton"> <Setter Property="FontSize" Value="12"/> <Setter Property="Padding" Value="5,3,5,3"/> <Setter Property="Height" Value="26"/> <Setter Property="Cursor" Value="Hand"/> </Style> <!--文本框--> <Style TargetType="{x:Type TextBox}" x:Key="gTextBlock"> <Setter Property="Height" Value="28"/> <Setter Property="Width" Value="160"/> <Setter Property="Padding" Value="3"/> <Setter Property="FontSize" Value="14"/> <Setter Property="HorizontalAlignment" Value="Left"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="BorderBrush" Value="#adb2b5"/> </Style> <!--文本标签--> <Style TargetType="{x:Type Label}" x:Key="gLabel"> <Setter Property="FontSize" Value="14"/> <Setter Property="Foreground" Value="#006699"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Right"/> </Style> </UserControl.Resources> <!--分页框--> <Border Style="{StaticResource gBox}"> <StackPanel Orientation="Horizontal"> <Label Style="{StaticResource gLabel}" Content="转到"/> <TextBox Width="50" Style="{StaticResource gTextBlock}" Text="{Binding JumpNum}" /> <Label Style="{StaticResource gLabel}" Content="页"/> <Button Style="{StaticResource gmButton}" Margin="0,0,20,0" Content="GO" Command="{Binding JumpPageCommand}"/> <Button Style="{StaticResource gmButton}" Margin="0,0,10,0" Content="上一页" Command="{Binding PrevPageCommand}"/> <Button Style="{StaticResource gmButton}" Content="下一页" Command="{Binding NextPageCommand}"/> <Label Style="{StaticResource gLabel}" Content="【当前"/> <Label Style="{StaticResource gLabel}" Content="0" Foreground="Red"/> <Label Style="{StaticResource gLabel}" Content="页】"/> <Label Style="{StaticResource gLabel}" Content="【共"/> <Label Style="{StaticResource gLabel}" Content="0" Foreground="Red"/> <Label Style="{StaticResource gLabel}" Content="页】"/> <Label Style="{StaticResource gLabel}" Content="【共"/> <Label Style="{StaticResource gLabel}" Content="0" Foreground="Red"/> <Label Style="{StaticResource gLabel}" Content="条记录】"/> </StackPanel> </Border></UserControl>使用
添加引用:
xmlns:com="clr-namespace:Simple.Calculator.WinForm.Common"
XAML代码:
<!--分页框--><com:PageControl />
0 0
- WPF一个简单的分页控件
- 一个简单WPF分页条控件
- 一个wpf的数据分页控件
- 一个简单的分页控件
- 一个简单的分页控件
- 一个简单的分页控件(源码)
- 一个简单实用的分页控件
- 一个简单实用的分页控件
- wpf分页控件的实现
- 一个简单的分页控件,用来自定义分页用的
- 一个简单的分页控件,用来自定义分页用的
- 一个简单的数据行分页用户控件
- WPF 分页控件
- WPF分页控件
- wpf制作分页控件
- WPF自定义分页控件
- WPF简单分页导航的实现
- 一个简单的分页
- 深度学习Deep Learning 相关库简介
- Android设计模式应用-模板方法模式
- HDU 4144Bacon's Cipher (解码)
- 动态规划:从新手到专家
- UVa 11400 - Lighting System Design(白书,比较好)
- WPF一个简单的分页控件
- 拓扑排序
- 结构型模式之外观模式
- J2EE中出现出现creation of element failed org.eclipse.core.internal.registry.configurationelementhandle错误
- Android RecyclerView + CardView的使用
- VM12激活码
- HDU 3535 AreYouBusy(混合背包+分组背包/至少取一件)
- 贾扬清:希望Caffe成为深度学习领域的Hadoop
- 【Vim】使用Vundle管理配置Vim基本插件