0

我正在尝试创建一个新窗口,

WinMain meniu = new WinMain();
this.Close();
meniu.ShowDialog();

我想知道如何在新窗口上添加按钮之类的东西,以及如何编辑它的参数甚至是一个函数

private void Window_Loaded(object sender, RoutedEventArgs e)
4

1 回答 1

0

这是一个 Windows 表单示例,我在创建表单后添加了一个按钮:

        var form = new Form1();
        form.SuspendLayout();
        var button2 = new System.Windows.Forms.Button();
        button2.Location = new System.Drawing.Point(279, 20);
        button2.Name = "button1";
        button2.Size = new System.Drawing.Size(75, 23);
        button2.TabIndex = 0;
        button2.Text = "button1";
        button2.UseVisualStyleBackColor = true;

        form.Controls.Add(button2);
        form.ResumeLayout(false);

        Application.Run(form);
于 2013-05-17T11:16:49.017 回答