zoukankan      html  css  js  c++  java
  • WPF

    1. Image的Source设定,引用的图片文件在其他的dll中。图片的Build action : Resource

    如果是直接写:

    Source="/MyProject.Resources;Component/Images/Icon.gif"  

    如果是binding

    Source="{Binding Path=Path}"
    
    // code behind:
    Path = "pack://application:,,,/MyProject.Resources;component/Images/Icon.gif";

     2. C#执行外部Exe

                Process proc = new Process();
                proc.StartInfo = new ProcessStartInfo()
                {
                    FileName = @"abc.pdf" //put your path here
                };
                proc.Start();

     3. Listbox 选中item不高亮

    <Style.Resources>
        <!-- Background of selected item when focussed -->
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
                         Color="Green"/>
        <!-- Background of selected item when not focussed -->
        <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}"
                         Color="LightGreen" />
    </Style.Resources> 
    

    4. set focus in textbox in WPF

    <StackPanel FocusManager.FocusedElement="{Binding ElementName=Box}">
       <TextBox Name="Box" />
    </StackPanel>
    

      

    5. 2014-12-09 DataGrid中,默认会选中第一行,如果想取消选中。以后都不选。可以这样:

    <DataGrid x:Name="data"  IsSynchronizedWithCurrentItem="{x:Null}" ...>
    

      

  • 相关阅读:
    一段简单的js让png24兼容ie6,单张图片有效
    “按需加载”的应用
    前端....
    项目小结
    Ember初始化实例
    Emberjs 分页
    Emberjs搜索
    promise链式
    Emberjs路由
    Emberjs笔记
  • 原文地址:https://www.cnblogs.com/mantian/p/3939383.html
Copyright © 2011-2022 走看看