首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我试着进口,制造窗户,几乎所有的错误

我试着进口,制造窗户,几乎所有的错误
EN

Stack Overflow用户
提问于 2022-03-29 21:04:54
回答 1查看 23关注 0票数 0

当我试图使用github-Copilot时,我试图制作一个带有圆圈的c#窗口。我不明白为什么会出错。为什么会出错?它是怎么出错的?为什么进口失败了?

就目前而言,我还不太了解c#。我可能需要一些关于错误的帮助。不管是谁帮助了我,我非常感谢你。回到细节

我试着在一个窗口中做一个圆圈,通过点击一个按钮就可以收缩和生长,而github- copilot插入了导入(使用)我们是如何制作的圆圈: Eclipse。

这是在我做代码的时候用视觉代码做的。但是我在visual studio 2019中导入了它,这些都是错误:代码错误

你的代码:

代码语言:javascript
复制
using System.Collections.Generic;
using System.Linq;
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;
// Create circle game namespace

// Make the window
public partial class MainWindow : Window
{
    public MainWindow()
    {
        // Initialize the window
        InitializeComponent();
    }
    private void MakeCircle(object sender, RoutedEventArgs e)
    {
        // Make the circle
        Ellipse circle = new Ellipse();
        // Set the size of the circle
        circle.Height = 100;
        circle.Width = 100;
        circle.Fill = Brushes.Red;
        circle.Margin = new Thickness(100, 100, 0, 0);
        canvas.Children.Add(circle);
    }
    private void GrowCircle(object sender, RoutedEventArgs e)
    {
        // Make the circle grow
        circle.Height += 10;
        circle.Width += 10;
    }

    private void ShrinkCircle(object sender, RoutedEventArgs e)
    {
        circle.Height -= 10;
        circle.Width -= 10;
    }
}```
EN

回答 1

Stack Overflow用户

发布于 2022-03-29 21:24:30

我认为这是因为您选择了一个不正确的输出类型:

请看一下。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71668765

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档