-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
67 lines (66 loc) · 4.88 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<Window x:Class="BossKey.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BossKey"
mc:Ignorable="d"
Title="BossKey「代码见三」" Height="400" Width="500" Loaded="Window_Loaded">
<Grid>
<Menu>
<MenuItem x:Name="OpenAboutWindow" Header="关于" Click="OpenAboutWindow_Click"></MenuItem>
</Menu>
<ListView x:Name="WindowListView" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard" d:ItemsSource="{d:SampleData ItemCount=5}" Margin="0,20,0,125">
<ListView.View>
<GridView>
<GridViewColumn Header="可视" Width="30" DisplayMemberBinding="{Binding VisibleText}"/>
<GridViewColumn Header="句柄" Width="60" DisplayMemberBinding="{Binding Hwnd}"/>
<GridViewColumn Header="窗口名" Width="360" DisplayMemberBinding="{Binding Name}"/>
</GridView>
</ListView.View>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="ToolTipService.ToolTip">
<Setter.Value>
<TextBlock Text="{Binding FilePath}">
<!--<Run Text="{Binding Pid, StringFormat={}Pid:{0}}" />
<Run Text=" " />
<Run Text="{Binding FilePath}" />-->
</TextBlock>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
</ListView>
<Button x:Name="RefreshWindowsListViewButton" Content="刷新" HorizontalAlignment="Right" VerticalAlignment="Top" Width="40" Height="20" Click="RefreshWindowListViewButton_Click" Margin="0,1,25,0"/>
<TabControl VerticalAlignment="Bottom" Height="101" Margin="0,0,0,20">
<TabItem Header="用快捷键">
<Grid Background="#FFE5E5E5">
<TextBlock HorizontalAlignment="Left" Margin="10,5,0,0" TextWrapping="Wrap" Text="老板键:" Height="15" VerticalAlignment="Top"/>
<TextBox x:Name="HotKeyTextBox" HorizontalAlignment="Left" Margin="58,5,0,0" TextWrapping="NoWrap" Text="Alt+E" Width="107" Height="17" VerticalAlignment="Top" PreviewKeyDown="HotKeyTextBox_PreviewKeyDown" PreviewMouseDown="HotKeyTextBox_PreviewMouseDown"/>
<Button x:Name="AddHotKeyButton" Content="添加" HorizontalAlignment="Left" Margin="170,5,0,0" Width="50" Click="AddHotKeyButton_Click" Height="19" VerticalAlignment="Top"/>
<Button x:Name="DelHotKeyButton" Content="删除" HorizontalAlignment="Left" Margin="230,5,0,0" Width="50" Click="DelHotKeyButton_Click" Height="19" VerticalAlignment="Top"/>
<TextBlock Text="目标窗口:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,25,0,0"></TextBlock>
<TextBlock x:Name="HotKekWindowListTextBlock" Text="" Margin="70,25,10,10" TextWrapping="Wrap"/>
</Grid>
</TabItem>
<TabItem Header="用鼠标">
<Grid Background="#FFE5E5E5">
<ComboBox x:Name="MouseComboBox" HorizontalAlignment="Left" VerticalAlignment="Top" SelectedIndex="0" Width="120" Height="20" Margin="10,5,0,0">
<ComboBoxItem>鼠标中键</ComboBoxItem>
<ComboBoxItem>左右键同时按下</ComboBoxItem>
<ComboBoxItem>鼠标位置</ComboBoxItem>
</ComboBox>
<Button x:Name="AddMouseButton" Content="添加" HorizontalAlignment="Left" Margin="150,5,0,0" Width="50" Height="19" VerticalAlignment="Top" Click="AddMouseButton_Click"/>
<Button x:Name="DelMouseButton" Content="删除" HorizontalAlignment="Left" Margin="210,5,0,0" Width="50" Height="19" VerticalAlignment="Top" Click="DelMouseButton_Click"/>
<TextBlock Text="“鼠标位置”:鼠标放到目标窗口上是窗口显示,移开隐藏" Margin="10,25,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"></TextBlock>
<TextBlock Text="目标窗口:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,40,0,0"></TextBlock>
<TextBlock x:Name="MouseWindowListTextBlock" Text="" Margin="70,40,10,10" TextWrapping="Wrap"/>
</Grid>
</TabItem>
</TabControl>
<StatusBar Height="20" VerticalAlignment="Bottom">
<TextBlock Text="控制本程序的热键为Alt + P"></TextBlock>
</StatusBar>
</Grid>
</Window>