怎么激活窗体 本帖最后由 xiandawang 于 2010-08-25 09:43:32 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 非api方法,是调用窗体的Show。api方法,调用SetForegroundWindow(A_object.Handle) Form2 form2= new Form2(); private void button1_Click(object sender, EventArgs e) { form2.WindowState = FormWindowState.Normal; form2.Show(); } 给你一个简单的例子form1的创建form2的代码 private void Form1_Load(object sender, EventArgs e) { Form2 form2 = new Form2(this); form2.Show(); }form2的代码using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication2{ public partial class Form2 : Form { public Form2(Form1 parent) { InitializeComponent(); this.MdiParent = parent; } private void timer1_Tick(object sender, EventArgs e) { this.MdiParent.WindowState = FormWindowState.Normal; } }}记得定时器的Enable = true(在你想设置的地方) 给你一个简单的例子form1的创建form2的代码 private void Form1_Load(object sender, EventArgs e) { Form2 form2 = new Form2(this); form2.Show(); }form2的代码using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication2{ public partial class Form2 : Form { public Form2(Form1 parent) { InitializeComponent(); this.MdiParent = parent; } private void timer1_Tick(object sender, EventArgs e) { this.MdiParent.WindowState = FormWindowState.Normal; } }} LX你的道德太低了吧,完全copy我的代码!大家鄙视你! 多线程的问题 找不到类型或命名空间名称“CSimpleDictSeg”(是否缺少 using 指令或程序集引用?) c#问题 求正则表达式高亮显示关键字,不知道怎么写 winform中的焦点问题(问题再续)太让我失望了 如何创建与读取Excel 2007文件 ########请问关于WebServer##### 怪事!从html页面的form表单不能向.aspx页面提交!(在线等) 播放器 一个初级问题:查询的时候怎么加入查询条件? C#为何读不出ini文件的值? 在一个组框groupbox中,放两个radiobox控件,竟然都可以为 Checked = true;
api方法,调用SetForegroundWindow(A_object.Handle)
private void button1_Click(object sender, EventArgs e)
{
form2.WindowState = FormWindowState.Normal;
form2.Show();
}
form1的创建form2的代码
private void Form1_Load(object sender, EventArgs e)
{
Form2 form2 = new Form2(this);
form2.Show();
}
form2的代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication2
{
public partial class Form2 : Form
{
public Form2(Form1 parent)
{
InitializeComponent(); this.MdiParent = parent;
} private void timer1_Tick(object sender, EventArgs e)
{
this.MdiParent.WindowState = FormWindowState.Normal;
}
}
}记得定时器的Enable = true(在你想设置的地方)
form1的创建form2的代码
private void Form1_Load(object sender, EventArgs e)
{
Form2 form2 = new Form2(this);
form2.Show();
}
form2的代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication2
{
public partial class Form2 : Form
{
public Form2(Form1 parent)
{
InitializeComponent(); this.MdiParent = parent;
} private void timer1_Tick(object sender, EventArgs e)
{
this.MdiParent.WindowState = FormWindowState.Normal;
}
}
}