zoukankan      html  css  js  c++  java
  • WPF FAQ for me

    1. Capture Mouse是怎么回事?

    UIElement.CaptureMouse() and Mouse.Capture()
    Capture mouse能够使 即使在控件之外也能够获取鼠标事件,拖,拉鼠标时最有用。
    When an element captures the mouse, it receives mouse input whether or not the cursor is within its borders.

    释放:UIElement.ReleaseMouseCapture() 或者Mouse.Capture(null)

    注意只能获取MouseUp 与MouseDown事件,其他的如MouseLeftUp与MouseLeftDown不能获取

    2. XAML中的Uid是做什么用的?

    x:Uid Attribute

    x:Uid Attribute是XAML中唯一的特例:它可以放在一个property element中,任何其他的attribute放在property 元素上都是非法的。它是被Localization 进程或者工具使用的。

    3. 如何理解GridUnitType

    GridUnitType

    <Window x:Class="WpfApplication1.Window1"
        xmlns
    ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x
    ="http://schemas.microsoft.com/winfx/2006/xaml"
        Title
    ="Window1" Height="300" Width="350" Margin="0,0,0,0">
        
    <Grid ShowGridLines="True" Width="300">
            
    <!--the availabe width for this grid is 300 pixel-->
            
    <Grid.ColumnDefinitions>
                
    <ColumnDefinition Width="Auto"></ColumnDefinition>
                
    <!--The width of this column is determined by its content, its 20pixel-->
                
    <ColumnDefinition Width="2*"></ColumnDefinition>
                
    <!--the remaining space is 280pixel(300-20),divided by 6,this column will have 2*(280/6)=93-->
                
    <ColumnDefinition Width="3*"></ColumnDefinition>
                
    <ColumnDefinition Width="1*"></ColumnDefinition>
            
    </Grid.ColumnDefinitions>
            
    <Grid.RowDefinitions>
                
    <RowDefinition></RowDefinition>
                
    <RowDefinition></RowDefinition>
                
    <RowDefinition></RowDefinition>
            
    </Grid.RowDefinitions>
            
    <Button Width="20" Grid.Column="0"></Button>
            
    <!--the width of this button determine the width of first column-->
        
    </Grid>
    </Window>
  • 相关阅读:
    20100420 ~ 20100520 小结与本月计划
    打造第二代测试框架TestDriven 2.0(六)—— 最新测试思路分析
    C# 反射性能测试
    Java 反射与cglib.proxy与cglib.beanmap与直接赋值 性能对比
    Apache Mina 源码分析。
    msn in c#, 最新代码
    20100520 ~ 20100620 小结与本月计划
    messageflow 集成到信息系统 第一阶段 手稿
    flash > AMF > java 的对象映射关系
    我在想:也许.net的基因里面就输给了java
  • 原文地址:https://www.cnblogs.com/whyandinside/p/1593009.html
Copyright © 2011-2022 走看看