按照win7开始菜单封面设计。
可运行在win10/winXp等系统
使用Everything 加速搜索功能
运行效果如图所示
;R1 第一次发布
;R2 优化界面,增加配置和多语言支持
;R3 支持界面失去焦点后自动隐藏,右击文件夹增加打开文件夹功能
;R4 修复64位版本不符图标加载异常bug(编译为anyCPU版本),
; 添加鼠标和键盘钩子,鼠标中间/Win键 可显示/隐藏界面
; 鼠标右击以管理员权限运行程序/打开文件夹
;R5 修复win按键bug
;R6 去掉按键钩子,优化程序启动两次bug
;R7 增加多路径开始菜单加载
;R8 增加定时关机和定时护眼保护
;R9 限制程序不能多开
;R11 合并同一层相同名称文件夹,修改弹窗未置顶bug,更新安装包图标,增加自动关闭已打开进程,命令周期改为5s
;R12 优化界面显示
;R13 增加锁屏和屏保时间统计,增加异常捕获,使用UTC时间计算相对时间不再受当地时间影响
;R14 修改锁屏时间计算错误,增加Everything搜索功能,优化使用功能
;R15 优化界面子目录显示,增加右键菜单功能
有兴趣的朋友可下载免费使用:
https://download.csdn.net/download/u012842630/11982178
<Window x:Class="Start10.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="510" Width="420" ResizeMode="CanResizeWithGrip" WindowStyle="None" AllowsTransparency="True" Background="Transparent" Icon="windows8.ico">
<Window.Resources>
<Style x:Key="RightButton" TargetType="{x:Type Button}">
<Setter Property="Control.Background" Value="#FF366A9E"/>
<Setter Property="Control.FontSize" Value="14"/>
<Setter Property="Control.Height" Value="30"/>
<Setter Property="Control.Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" BorderThickness="5" BorderBrush="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FF6698DE"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="PowerButton" TargetType="{x:Type Button}">
<Setter Property="Control.Background" Value="#C04C77B4"/>
<Setter Property="Control.FontSize" Value="14"/>
<Setter Property="Control.Height" Value="30"/>
<Setter Property="Control.Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" BorderThickness="5" BorderBrush="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FF6698DE"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="AllProgramButton" TargetType="{x:Type Button}">
<Setter Property="Control.Background" Value="#FFDADADA"/>
<Setter Property="Control.FontSize" Value="12"/>
<Setter Property="Control.Height" Value="24"/>
<Setter Property="Control.Foreground" Value="Black"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" BorderThickness="5" BorderBrush="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FF6698DE"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid Background="Transparent" Margin="0,0,0,0">
<Grid Background="#FF366A9E" Margin="0,25,0,0">
<ListBox Name="lb_List" HorizontalAlignment="Left" Height="441" VerticalAlignment="Top" Width="250" MouseLeftButtonDown="lb_List_MouseLeftButtonDown">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30" ></ColumnDefinition>
<ColumnDefinition Width="auto" ></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Name="image" Source="{Binding Pic}" Width="18" Height="18" Tag="1" HorizontalAlignment="Left" Grid.Column="0"/>
<TextBlock Text="{Binding Name}" Width="auto" Height="auto" VerticalAlignment="Center" Grid.Column="1"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Border BorderBrush="Gray" Margin="0,0,170,25" VerticalAlignment="Bottom" BorderThickness="2">
<Grid Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Name="btn_UserPined" Content="<" BorderBrush="Transparent" Grid.Column="0" HorizontalContentAlignment="Center" Style="{StaticResource AllProgramButton}" Width="auto" Click="btn_UserPin_Click"/>
<Button Name="btn_UserPin" Content="返回" BorderBrush="Transparent" Grid.Column="1" HorizontalContentAlignment="Left" Style="{StaticResource AllProgramButton}" Width="auto" Click="btn_UserPin_Click"/>
</Grid>
</Border>
<Menu HorizontalAlignment="Left" Height="26" Margin="315,432,0,12" VerticalAlignment="Bottom" Width="25" Background="#C04C77B4">
<MenuItem Header=">" Background="#C04C77B4" FontSize="12" Height="26" VerticalContentAlignment="Center" Foreground="White">
<MenuItem Name="mi_SwitchUser" Header="切换用户(_W)" Foreground="Black" Click="mi_SwitchUser_Click"/>
<MenuItem Name="mi_Logout" Header="注销(_I)" Foreground="Black" Click="mi_Logout_Click"/>
<MenuItem Name="mi_Lock" Header="锁定(_O)" Foreground="Black" Click="mi_Lock_Click"/>
<Separator/>
<MenuItem Name="mi_Reboot" Header="重启(_R)" Foreground="Black" Click="mi_Reboot_Click"/>
<Separator/>
<MenuItem Name="mi_Sleep" Header="睡眠(_S)" Foreground="Black" Click="mi_Sleep_Click"/>
<MenuItem Name="mi_Hibernate" Header="休眠(_H)" Foreground="Black" Click="mi_Hibernate_Click"/>
</MenuItem>
</Menu>
<Button Content="关机" HorizontalAlignment="Left" Margin="258,0,0,11" VerticalAlignment="Bottom" Height="28" Width="55" Style="{StaticResource PowerButton}" Click="Button_ShutDown_Click"/>
<Border BorderBrush="#FFF0EBEB" Margin="0,0,170,0" VerticalAlignment="Bottom" BorderThickness="4" Background="#FFF0EBEB">
<Grid HorizontalAlignment="Left" Height="20" Margin="0" VerticalAlignment="Bottom" Width="245" Background="White">
<TextBox x:Name="TbxInput" Grid.Column="1" KeyDown="TbxInput_OnKeyDown">
<TextBox.Template>
<ControlTemplate TargetType="TextBox">
<Grid>
<TextBlock x:Name="Uc_TblShow" Text="搜索程序和文件..." Foreground="Gray" Opacity="0.5" VerticalAlignment="Center" Visibility="Collapsed"></TextBlock>
<TextBox x:Name="Uc_TbxContent" Foreground="Black" Background="Transparent" VerticalAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0"
Text="{Binding ElementName=TbxInput,Path=Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="12"></TextBox>
</Grid>
<ControlTemplate.Triggers>
<Trigger SourceName="Uc_TbxContent" Property="Text" Value="">
<Setter TargetName="Uc_TblShow" Property="Visibility" Value="Visible"></Setter>
</Trigger>
<Trigger SourceName="Uc_TbxContent" Property="IsFocused" Value="True">
<Setter TargetName="Uc_TblShow" Property="Visibility" Value="Collapsed"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</TextBox.Template>
</TextBox>
<Button Name="BtnSearch" Click="BtnSearch_OnClick" Cursor="Hand" BorderThickness="1" Margin="0,0,0,0" Background="White">
<Button.Template>
<ControlTemplate TargetType="Button" >
<Grid>
<ContentPresenter></ContentPresenter>
<Image Name="Uc_Image" Source="pack://SiteOfOrigin:,,,/images/default/icon_search.png" Height="18" Width="18" Margin="0,0,5,0" HorizontalAlignment="Right" MouseUp="Uc_Image_MouseUp"></Image>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Uc_Image" Property="Height" Value="22"></Setter>
<Setter TargetName="Uc_Image" Property="Width" Value="22"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</Border>
<Button Name="btn_user" Content="用户" Margin="250,90,0,0" VerticalAlignment="Top" Width="171" Style="{StaticResource RightButton}" Click="btn_links_Click"/>
<Button Name="btn_file" Content="文档" Margin="250,120,0,0" VerticalAlignment="Top" Width="171" Style="{StaticResource RightButton}" Click="btn_links_Click"/>
<Button Name="btn_picture" Content="图片" Margin="250,150,0,0" VerticalAlignment="Top" Width="171" Style="{StaticResource RightButton}" Click="btn_links_Click"/>
<Button Name="btn_music" Content="音乐" Margin="250,180,0,0" VerticalAlignment="Top" Width="171" Style="{StaticResource RightButton}" Click="btn_links_Click"/>
<Button Name="btn_ui" Content="Win10 UI" Margin="250,210,0,0" VerticalAlignment="Top" Width="171" Style="{StaticResource RightButton}" Click="btn_links_Click"/>
<Button Name="btn_computer" Content="此电脑" Margin="250,240,0,0" VerticalAlignment="Top" Width="171" Style="{StaticResource RightButton}" Click="btn_links_Click"/>
<Button Name="btn_control" Content="控制面板" Margin="250,270,0,0" VerticalAlignment="Top" Width="171" Style="{StaticResource RightButton}" Click="btn_links_Click"/>
<Button Name="btn_setting" Content="设置" Margin="250,300,0,0" VerticalAlignment="Top" Width="171" Style="{StaticResource RightButton}" Click="btn_links_Click"/>
<Button Name="btn_devices" Content="设备和打印机" Margin="250,330,0,0" VerticalAlignment="Top" Width="171" Style="{StaticResource RightButton}" Click="btn_links_Click"/>
</Grid>
<Grid HorizontalAlignment="Right" Background="White" Height="60" Margin="0,0,45,0" VerticalAlignment="Top" Width="60">
<Border BorderBrush="White" BorderThickness="3">
<Image Margin="0" Source="pack://SiteOfOrigin:,,,/images/default/user.png" StretchDirection="Both"/>
</Border>
</Grid>
</Grid>
</Window>