111,097
社区成员




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication181
{
public partial class Form1 : Form
{
TextBox TB = new TextBox();
Button B = new Button();
WebBrowser WB = new WebBrowser();
bool IsReplyFrame = false;
public Form1()
{
InitializeComponent();
this.Size = new Size(800, 800);
this.StartPosition = FormStartPosition.CenterScreen;
TB.Parent = this;
TB.Dock = DockStyle.Top;
TB.KeyDown += new KeyEventHandler(TB_KeyDown);
B.Parent = this;
B.Dock = DockStyle.Bottom;
B.Click += new EventHandler(B_Click);
B.Text = "写回复";
WB.Parent = this;
WB.Dock = DockStyle.Fill;
WB.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(WB_DocumentCompleted);
}
void TB_KeyDown(object sender, KeyEventArgs e)
{
IsReplyFrame = false;
if (e.KeyCode == Keys.Enter)
WB.Navigate(TB.Text);
}
void WB_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (!IsReplyFrame)
{
String RelayUrl = WB.Document.GetElementById("replyframe").GetAttribute("src");
WB.Navigate(RelayUrl);
IsReplyFrame = true;
}
}
void B_Click(object sender, EventArgs e)
{
WB.Document.GetElementById("tb_ReplyBody$_$Editor").InnerText = "回复!!!!!!";
}
}
}