WPF 远程显示原图 当前主页面 工具栏 一个Window页面的元素适用一个效果

http://www.jb51.net/article/98384.htm

 

1.wpf远程显示原图:

Stretch="Fill"

string enterImgPath = "远程地址" + @".//EnterCarPic\05-03\test.jpg" + "&w=" + 950 + "&h=" + 650;

主要是因为那个950和650,据显示位置大小给予

 

2.当前主页面:Application.Current.MainWindow引用程序的主窗口(几个主窗口另当别论)

http://www.cnblogs.com/tsliwei/p/6212162.html

 

3.工具栏

 <ToolBar   Height="55" Background="#343536"  DockPanel.Dock="Top" >  
                
                <Button Tag="月卡查询"  Name="YKCX">                  
                    <StackPanel >
                        <Border BorderBrush="White" BorderThickness="0,0,0,1"  CornerRadius="3" Width="40" Height="30">
                            <Button x:Name="btn_DisCountCardInfo" ToolTip="月卡查询" Style="{DynamicResource SystemButton}" Click="btn_DisCountCardInfo_Click" >
                                <!-- Click=""-->
                                <Button.Background>
                                    <ImageBrush ImageSource="images/fax.ico"></ImageBrush>
                                </Button.Background>
                            </Button>
                           
                        </Border>
                       <!-- <ToolBar  >
                            <Menu DockPanel.Dock="Top">
                                <MenuItem Header="查看信息" >
                                    <MenuItem Header="打开">
                                        <MenuItem Header="1.txt"></MenuItem>
                                        <MenuItem Header="2.txt"></MenuItem>
                                        <MenuItem Header="3.txt"></MenuItem>
                                    </MenuItem>
                                    <MenuItem Header="退出" Name="miExit2"></MenuItem>
                                </MenuItem>
                            </Menu>
                        </ToolBar>-->
                        <TextBlock FontSize="10"  HorizontalAlignment="Center" VerticalAlignment="Bottom" >
                            <TextBlock.Text>月卡查询</TextBlock.Text>
                            <TextBlock.Foreground>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Color="Gray" Offset="0.0" />
                                    <GradientStop Color="Gray" Offset="1.0" />
                                </LinearGradientBrush>
                            </TextBlock.Foreground>
                        </TextBlock>
                    </StackPanel>
                    
                </Button>
                <Separator></Separator>

                <Button Tag="VIP卡查询"  Name="VIPCQ" Visibility="Collapsed">
                    <StackPanel >
                        <Border BorderBrush="White" BorderThickness="0,0,0,1"  CornerRadius="3" Width="40" Height="30">
                            <Button x:Name="btn_DisCountCardInfo2" ToolTip="VIP卡查询" Style="{DynamicResource SystemButton}" >
                                <!-- Click=""-->
                                <Button.Background>
                                    <ImageBrush ImageSource="images/fax.ico"></ImageBrush>
                                </Button.Background>
                            </Button>
                        </Border>
                        <TextBlock FontSize="10"  HorizontalAlignment="Center" VerticalAlignment="Bottom" >
                            <TextBlock.Text>VIP卡查询</TextBlock.Text>
                            <TextBlock.Foreground>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Color="Gray" Offset="0.0" />
                                    <GradientStop Color="Gray" Offset="1.0" />
                                </LinearGradientBrush>
                            </TextBlock.Foreground>
                        </TextBlock>
                    </StackPanel>
                </Button>
                <Separator Name="sptor_VIPCardQuery" Visibility="Collapsed"></Separator>

                <Button Tag="交接班"  Name="JJB">
                    <StackPanel >
                        <Border BorderBrush="White" BorderThickness="0,0,0,1"  CornerRadius="3" Width="40" Height="30">
                            <Button x:Name="btn_DisCountCardInfo3" ToolTip="交接班" Style="{DynamicResource SystemButton}" >
                                <!-- Click=""-->
                                <Button.Background>
                                    <ImageBrush ImageSource="images/fax.ico"></ImageBrush>
                                </Button.Background>
                            </Button>
                        </Border>
                        <TextBlock FontSize="10"  HorizontalAlignment="Center" VerticalAlignment="Bottom" >
                            <TextBlock.Text>交接班</TextBlock.Text>
                            <TextBlock.Foreground>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Color="Gray" Offset="0.0" />
                                    <GradientStop Color="Gray" Offset="1.0" />
                                </LinearGradientBrush>
                            </TextBlock.Foreground>
                        </TextBlock>
                    </StackPanel>
                </Button>
                <Separator></Separator>
               
                <Button Tag="收费情况" Name="收费情况">
                    <StackPanel >
                        <Border BorderBrush="White" BorderThickness="0,0,0,1"  CornerRadius="3" Width="40" Height="30">
                            <Button x:Name="btn_DisCountCardInfo4" ToolTip="收费情况" Style="{DynamicResource SystemButton}" >
                                <!-- Click=""-->
                                <Button.Background>
                                    <ImageBrush ImageSource="images/fax.ico"></ImageBrush>
                                </Button.Background>
                            </Button>
                        </Border>
                        <TextBlock FontSize="10"  HorizontalAlignment="Center" VerticalAlignment="Bottom" >
                            <TextBlock.Text>收费情况</TextBlock.Text>
                            <TextBlock.Foreground>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Color="Gray" Offset="0.0" />
                                    <GradientStop Color="Gray" Offset="1.0" />
                                </LinearGradientBrush>
                            </TextBlock.Foreground>
                        </TextBlock>
                    </StackPanel>
                </Button>
                <Separator></Separator>
                <Button Tag="设置"  Name="设置">
                    <StackPanel >
                        <Border BorderBrush="White" BorderThickness="0,0,0,1"  CornerRadius="3" Width="40" Height="30">
                            <Button x:Name="btn_DisCountCardInfo5" ToolTip="设置" Style="{DynamicResource SystemButton}" >
                                <!-- Click=""-->
                                <Button.Background>
                                    <ImageBrush ImageSource="images/fax.ico"></ImageBrush>
                                </Button.Background>
                            </Button>
                        </Border>
                        <TextBlock FontSize="10"  HorizontalAlignment="Center" VerticalAlignment="Bottom" >
                            <TextBlock.Text>设置</TextBlock.Text>
                            <TextBlock.Foreground>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Color="Gray" Offset="0.0" />
                                    <GradientStop Color="Gray" Offset="1.0" />
                                </LinearGradientBrush>
                            </TextBlock.Foreground>
                        </TextBlock>
                    </StackPanel>
                </Button>
                <Separator></Separator>
                <Button Tag="修改密码"  Name="修改密码">
                    <StackPanel >
                        <Border BorderBrush="White" BorderThickness="0,0,0,1"  CornerRadius="3" Width="40" Height="30">
                            <Button x:Name="btn_DisCountCardInfo6" ToolTip="修改密码" Style="{DynamicResource SystemButton}" >
                                <!-- Click=""-->
                                <Button.Background>
                                    <ImageBrush ImageSource="images/fax.ico"></ImageBrush>
                                </Button.Background>
                            </Button>
                        </Border>
                        <TextBlock FontSize="10"  HorizontalAlignment="Center" VerticalAlignment="Bottom" >
                            <TextBlock.Text>修改密码</TextBlock.Text>
                            <TextBlock.Foreground>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Color="Gray" Offset="0.0" />
                                    <GradientStop Color="Gray" Offset="1.0" />
                                </LinearGradientBrush>
                            </TextBlock.Foreground>
                        </TextBlock>
                    </StackPanel>
                </Button>
                <Separator></Separator>
                <Button Tag="关于"  Name="关于">
                    <StackPanel >
                        <Border BorderBrush="White" BorderThickness="0,0,0,1"  CornerRadius="3" Width="40" Height="30">
                            <Button x:Name="btn_DisCountCardInfo7" ToolTip="关于" Style="{DynamicResource SystemButton}" >
                                <!-- Click=""-->
                                <Button.Background>
                                    <ImageBrush ImageSource="images/fax.ico"></ImageBrush>
                                </Button.Background>
                            </Button>
                        </Border>
                        <TextBlock FontSize="10"  HorizontalAlignment="Center" VerticalAlignment="Bottom" >
                            <TextBlock.Text>关于</TextBlock.Text>
                            <TextBlock.Foreground>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Color="Gray" Offset="0.0" />
                                    <GradientStop Color="Gray" Offset="1.0" />
                                </LinearGradientBrush>
                            </TextBlock.Foreground>
                        </TextBlock>
                    </StackPanel>
                </Button>
            </ToolBar>
            <!--<ToolBar DockPanel.Dock="Top" Height="50" >
                <Image Source="images/fax.ico" Width="150"></Image>
                <Button Tag="现金收费"  >
                    <Image Source="images/fax.ico"   ></Image>
                   
                </Button>
              
                <Border BorderBrush="SteelBlue" >
                   
                    <Button Content=" hhhhhhhhh"  >

                    </Button>
                </Border>
                <Menu DockPanel.Dock="Top">
                    <MenuItem Header="文件">
                        <MenuItem Header="打开">
                            <MenuItem Header="1.txt"></MenuItem>
                            <MenuItem Header="2.txt"></MenuItem>
                            <MenuItem Header="3.txt"></MenuItem>
                        </MenuItem>
                        <MenuItem Header="退出" Name="miExit2" Click="miExit_Click"></MenuItem>
                    </MenuItem>
                    <MenuItem Header="编辑">
                        <MenuItem Header="复制"></MenuItem>
                        <MenuItem Header="粘贴"></MenuItem>
                    </MenuItem>
                </Menu>
                <Button>
                            <Image Source="images/fax.ico"></Image>
                 </Button>
                 
            </ToolBar>-->

 4.一个Window页面的元素适用一个效果:

  <Window.Resources>
        <Style TargetType="目标标签名称">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#000000" />
                </Trigger>
            </Style.Triggers>
        </Style>
      
    </Window.Resources>

 

posted @ 2017-05-06 09:18  wx_h13813744  阅读(222)  评论(0编辑  收藏  举报