• 大小: 51KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-13
  • 语言: C#
  • 标签: C#  

资源简介

这应该就是窗体间调用控件的最简单最好理解的代码了。 C#不像VB.NET,控件要讲究实例化,VB.NET哪里管那么多,拿来直接就用,如果控件的modifier的属性设为Public,更简单,连控件的所属表单都不用加,直接用控件名称就可以。

资源截图

代码片段和文件信息

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 WindowsFormsApplication5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        
        private void button1_Click(object sender EventArgs e)
        {
            Form2 f2 = new Form2();
            f2.Owner = this;
            f2.Show();
        }


        private void timer1_Tick(object sender EventArgs e)
        {
            label1.Text = System.DateTime.Now.ToString();
        }
 
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        187  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\App.config

     文件       9728  2018-11-02 15:22  WindowsFormsApplication5\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.exe

     文件        187  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.exe.config

     文件      28160  2018-11-02 15:22  WindowsFormsApplication5\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.pdb

     文件      23168  2018-11-02 15:23  WindowsFormsApplication5\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.vshost.exe

     文件        187  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.vshost.exe.config

     文件        490  2010-03-18 12:39  WindowsFormsApplication5\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.vshost.exe.manifest

     文件        744  2018-11-02 15:21  WindowsFormsApplication5\WindowsFormsApplication5\Form1.cs

     文件       2921  2018-11-02 15:02  WindowsFormsApplication5\WindowsFormsApplication5\Form1.Designer.cs

     文件       6011  2018-11-02 15:02  WindowsFormsApplication5\WindowsFormsApplication5\Form1.resx

     文件        755  2018-11-02 15:02  WindowsFormsApplication5\WindowsFormsApplication5\Form2.cs

     文件       2049  2018-11-02 14:52  WindowsFormsApplication5\WindowsFormsApplication5\Form2.Designer.cs

     文件       5817  2018-11-02 14:52  WindowsFormsApplication5\WindowsFormsApplication5\Form2.resx

     文件        865  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7015  2018-11-02 11:31  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件        921  2018-11-02 15:23  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.csproj.FileListAbsolute.txt

     文件       1035  2018-11-02 15:10  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.csproj.GenerateResource.Cache

     文件       9728  2018-11-02 15:22  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.exe

     文件        180  2018-11-02 15:10  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.Form1.resources

     文件        180  2018-11-02 15:10  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.Form2.resources

     文件      28160  2018-11-02 15:22  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.pdb

     文件        180  2018-11-02 15:10  WindowsFormsApplication5\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.Properties.Resources.resources

     文件        561  2018-11-02 14:06  WindowsFormsApplication5\WindowsFormsApplication5\Program.cs

     文件       1372  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\Properties\AssemblyInfo.cs

     文件       2900  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\Properties\Resources.Designer.cs

     文件       5612  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\Properties\Resources.resx

     文件       1111  2018-11-02 11:30  WindowsFormsApplication5\WindowsFormsApplication5\Properties\Settings.Designer.cs

............此处省略15个文件信息

评论

共有 条评论