我想请问从网页上复制下来的代码,为什么文本改了VBS格式以后打不开,提示语法错误呢?
<Window x:Name="closing" x:Class="BBdemo.MainWindow"xmlns="http://schemas.
xmlns:x="http://schemas.
xmlns:d="http://schemas.
xmlns:mc="http://schemas.
xmlns:local="clr-namespance:BBdemo"
mc:lgnorable="d"
Title="MainWindow" Height="450" width="800" Closing="closing_Closing">
<Grid>
<Grid.Background>
<ImageBrush/>
</Grid.Background>
<Button Name="btal" Content="同意" HorizontalAlignment="Left" Margin="168,326,0,0
VerticalAlignment="Top" Width="93" Height="42" Click="Button_Click"/>
<Label name="labl" Content="表白信" HorizontalAlignment="Left" Margin="33,44,0,0
VerticalAlignment="Top" Height="59" Width="129" FontSize="36" FontStyle="ltalic"/>
<Labol Name="lab2" Content="做我女朋友好吗? : : :"
HorizontalAlignment="Left" Height="60" Margin="493,200,0,0" VerticalAlignment="Top"
Width="281" FontSize="36"/>
<Button Name="btn3" Bisibility="Hidden" Content="退出" HorizontalAlignment="Left"
Height="42" Margin="326,326,0,0" VerticalAlignment="Top" width="90" Click="Button_Click_1"/>
<Imago Margin="206,10,316,6,109" Source="biaobal.png" Stretch="Fill"/>
<Button Name="btn2" Content="不同意" HorizontalAlignment="Left"
Margin="493,326,0,0" VerticalAlignment="Top" Width="93" Heigth="42"
MouseEnter="Button_MouseEnter"/>
</Grid>
</Window>
using System:
using System,Collections.Generic:
using System.Ling:
using System.Text:
using System.Threading.Tasks:
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:
namespace BBdemo
{
///<summary>
///MainWindow.xaml 的交互逻辑
///</summary>
public partial class MainWindow : Window
{
public MainWindow{}
{
InitializeComponent{}:
}
private void Button_MouseEnter(object sender. MouseEventArgs e)
{
Random rd = new Random():
Button bta = sender as Button:
double maxW = this.Width:
double maxH = this.Height:
double w = btn.Width:
double h = btn.Height:
double l = rd.Next(0. (int)(maxW-w)):
double t = rd.Next(0. (int)(maxH - h)):
bth,Margin = new Thickness(l,t,0,0):
}
private void closing_Closing(object sender, e)
{
MessageBox.Show("关不掉!”):
e.Cancel = true:
}
private void Button_Click(object sender, RoutedEventArga e)
{
labl.Visibility = System.Windows.Visibility.Hidden:
lab2.Content = "谢谢媳妇!":
btn3.Visibility = System.Windows.Visibility.Visible:
btn1.Visibility = System.Windows.Visibility.Hidden:
btn2.Visibility = System.Windows.Visibility.Hidden:
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
System.Environment.Exit(0):
}