110,533
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Opacity = 0.5;
Form2 form = new Form2();
this.form2 = form;
form.Owner = this;
form.Dock = DockStyle.Fill;
form.Show();
form.BringToFront();
}
private void progressBar1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Form2 form = new Form2();
form.ShowDialog();
}
private void Form1_LocationChanged(object sender, EventArgs e)
{
if (form2 != null)
{
this.form2.Location = this.Location;
}
}
Form2 form2;
private void Form1_Resize(object sender, EventArgs e)
{
if (this.form2 != null)
{
this.form2.Size = this.Size;
}
}
}
}