Winform中的经常使用控件使用

一些常见的winform基本控件的属性及方法ide

Label标签控件的属性及方法this

代码:spa

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

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            linkLabel1.LinkVisited = true; // 确认超文本连接是按照连接后的样式呈现
            Form2 newForm2 = new Form2(); // 实例化Form2窗体,命名为newForm
            newForm2.Show(); // 将实例化的窗体打开
            this.Hide(); // 当前的窗体隐藏
        }

        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            label2.Show(); // 当单击此连接时显示标签2
        }

        private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            label2.Hide(); // 当单击此连接时隐藏标签2
        }
    }
}

 界面:code

 属性及方法orm

TextBox文本框控件属性和方法blog

Button按钮控件属性及方法it

 

 

 

一直不明白打开一个控件后,怎么跳转到另外一个控件,看到这里才明白用hide和show方法能够达到跳转页面的效果。io

相关文章
相关标签/搜索