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}" ...>
    

      

  • 相关阅读:
    刷新SqlServer数据库中所有的视图
    代码的阅读
    unity3d的模型规范
    XOCDE5开发
    unity3d自动寻路教程
    u3d性能优化
    U3D层的运用
    关于unity3d插件的自动打包
    unity3d各平台通讯原生的平台API的说明
    uniSWF使用注意事项
  • 原文地址:https://www.cnblogs.com/mantian/p/3939383.html
Copyright © 2011-2022 走看看