问题描述
- VS2010创建的WPF浏览器程序运行时浏览器就停止工作了求指导
-
我用的WIN7操作系统(旗舰版),浏览器是用IE9。VS2010创建的WPF浏览器程序运行时浏览器就停止工作了,代码没有错误,请各位高手指导下。
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="Web">Storyboard.TargetProperty=
"(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"
RepeatBehavior="Forever">Storyboard.TargetProperty=
"(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"
RepeatBehavior="Forever">Storyboard.TargetProperty=
"(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"
RepeatBehavior="Forever">Storyboard.TargetProperty=
"(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"
RepeatBehavior="Forever">HorizontalAlignment="Left" VerticalAlignment="Top" Width="150">
<Ellipse.Fill> <RadialGradientBrush> <GradientStop Color="#FF000000" Offset="1" /> <GradientStop Color="#FFFFFFFF" Offset="0.306" /> </RadialGradientBrush> </Ellipse.Fill> </Ellipse> <Ellipse Margin="15,85,0,0" Name="ellipse1" Stroke="{x:Null}" Height="80" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Fill="Red" Opacity="0.5" RenderTransformOrigin="0.92,0.5"> <Ellipse.RenderTransform> <TransformGroup> <RotateTransform Angle="0" /> </TransformGroup> </Ellipse.RenderTransform> </Ellipse> <Ellipse Margin="85,15,0,0" Name="ellipse2" Stroke="{x:Null}" Height="120" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" Fill="Blue" Opacity="0.5" RenderTransformOrigin="0.5,0.92"> <Ellipse.RenderTransform> <TransformGroup> <RotateTransform Angle="0" /> </TransformGroup> </Ellipse.RenderTransform> </Ellipse> <Ellipse Margin="115,85,0,0" Name="ellipse3" Stroke="{x:Null}" Height="80" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Fill="Yellow" Opacity="0.5" RenderTransformOrigin="0.08,0.5"> <Ellipse.RenderTransform> <TransformGroup> <RotateTransform Angle="0" /> </TransformGroup> </Ellipse.RenderTransform> </Ellipse> <Ellipse Margin="85,115,0,0" Name="ellipse4" Stroke="{x:Null}" Height="80" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Fill="Green" Opacity="0.5" RenderTransformOrigin="0.5,0.08"> <Ellipse.RenderTransform> <TransformGroup> <RotateTransform Angle="0" /> </TransformGroup> </Ellipse.RenderTransform> </Ellipse> <Button Height="23" HorizontalAlignment="Left" Margin="20,0,0,56" Name="goButton" VerticalAlignment="Bottom" Width="75" Content="go"/> <Button Height="23" HorizontalAlignment="Right" Margin="0,0,21,56" Name="stopButton" VerticalAlignment="Bottom" Width="75" Content="stop"/> <Button Height="23" HorizontalAlignment="Left" Margin="85,0,86,16" Name="toggleButton" VerticalAlignment="Bottom" Width="75" Content="Toggle" Click="toggleButton_Click" /> </Grid>
以上这是Page1.Xaml的代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;namespace FirstWFPWed
{
///
/// Page1.xaml 的交互逻辑
///
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
}private void toggleButton_Click(object sender, RoutedEventArgs e) { Storyboard SpinStoryBoard = Resources["Spin"] as Storyboard; if (SpinStoryBoard != null) { if (SpinStoryBoard.GetIsPaused(this)) { SpinStoryBoard.Resume(this); } else { SpinStoryBoard.Pause(this); } } } }
以上这是.cs 的代码请各位高手指导下。