C\#크로스 창 동작(참조 전달)인 스 턴 스 코드
세 개의 창문 이 있 고 그 다음 순 서 는...
(1)첫 번 째 창 에 있 는 단 추 를 누 르 면 두 번 째 창 을 팝 업 하고 첫 번 째 창 을 숨 깁 니 다.
(2)두 번 째 창 은 일정 시간 까지 세 번 째 창 이 팝 업 됩 니 다.
(3)세 번 째 창 단 추 를 누 르 면 세 번 째 창 과 두 번 째 창 을 닫 고 첫 번 째 창 을 팝 업 합 니 다.From 1
using System;  
using System.Windows.Forms;  
namespace WindowsFormsApplication1  
{  
    public partial class Form1 : Form  
    {  
        public Form1()  
        {  
            InitializeComponent();  
        }  
        private void   form2  form1_Click(object sender, EventArgs e)  
        {  
            Form2 f = new Form2();  
            f.fatherForm = this;  
            f.Show();  
            this.Hide();  
        }  
    }  
}
Form2
using System;  
using System.Windows.Forms;  
namespace WindowsFormsApplication1  
{  
    public partial class Form2 : Form  
    {  
        public Form2()  
        {  
            InitializeComponent();  
        }  
        public Form1 fatherForm;  
        private void   from3_Click(object sender, EventArgs e)  
        {  
            Form3 f = new Form3();  
            f.fatherForm = this;  
            f.Show();  
        }  
    }  
}
Form3
using System;  
using System.Windows.Forms;  
namespace WindowsFormsApplication1  
{  
    public partial class Form3 : Form  
    {  
        public Form3()  
        {  
            InitializeComponent();  
        }  
        public Form2 fatherForm;  
        private void   form3from2  from1_Click(object sender, EventArgs e)  
        {  
            fatherForm.fatherForm.Show();  
            fatherForm.Close();  
            this.Close();  
        }  
    }  
}
                이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Linux 운영 명령 trLinux Shell 작업 명령 디 렉 터 리 총람 (자세 한 정 보 를 보 려 면 클릭) 1. 소개 tr 는 translate (변환) 의 줄 임 말이다. 2. 주요 기능 tr 명령 은 문자 찾기 와 교체 작업 에...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.