如何在当前窗口内弹出一个对话框,类似网页想实现像网页上jquery弹出对话框那样的功能,窗口变暗,


如何在当前窗口内弹出一个对话框,类似网页
想实现像网页上jquery弹出对话框那样的功能,窗口变暗,窗口内显示一幅带有阴影效果的图片

WIndow中已经有一个dockpanel,请问怎样才能实现弹出效果呢?

SilverLight .net 程序开发

qwe4372 14 years, 2 months ago

弹出时设置主窗体的透明度为50% 同时设置主窗体为只读就OK了

下雨没雨伞 answered 14 years, 2 months ago

  <Window x:Class="WpfApplication2.MainWindow"
        xmlns=""
        xmlns:x=""
        xmlns:local="clr-namespace:WpfApplication2"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <TextBox VerticalAlignment="Center" Name="textBox1" Text="1111" $amp;>amp;$lt;/TextBox>
        <TextBox Margin="0,50,0,0" VerticalAlignment="Center" Name="textBox2" Text="{Binding MyProperty2, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" $amp;>amp;$lt;/TextBox>
        <Border Background="Black" Opacity="0.1"$amp;>amp;$lt;/Border>
        <DockPanel Width="300" Height="200" VerticalAlignment="Center" HorizontalAlignment="Center" Background="White">
            <Border BorderBrush="Silver" BorderThickness="3">
                <Grid>
                    <TextBlock Text="test"$amp;>amp;$lt;/TextBlock>
                </Grid>
            </Border>
        </DockPanel>
    </Grid>
</Window>


上述代码就可以实现,在实现的工程中控制DockPanel和Border的Visibility就可以了

死在化粪池里 answered 14 years, 2 months ago

Your Answer