栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 游戏开发 > Unity3D

【C#上位机(弹出窗体的设计)】

Unity3D 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【C#上位机(弹出窗体的设计)】

1.控制台添加弹出窗体
1.1 右键项目名称–》添加–》windows窗体

1.2 添加

1.3 Program.cs程序设计

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 弹出窗体设计
{
    class Program
    {
        static void Main(string[] args)
        {
            Form1 form1 = new Form1();
            Console.WriteLine("请输入弹出内容:");
            form1.str = Console.ReadLine();
            form1.ShowDialog();
            
        }
    }
}

1.4 Form1窗体设计

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 弹出窗体设计
{
    public partial class Form1 : Form
    {
        public string str; 

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            textBox1.Text = str;
        }
    }
}


1.5 Form2窗体设计

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 弹出窗体设计
{
    public partial class Form2 : Form
    {
        public string str; 

        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            textBox1.Text = str;
        }
    }
}


2.运行结果

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/898755.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号