菜單欄
#region//菜單欄
/// <summary>
/// 另存為
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void saveasToolStripMenuItem_Click(object sender, EventArgs e)
{
getCurrentBrowser().ShowSaveAsDialog();
}
/// <summary>
/// 打印
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
getCurrentBrowser().ShowPrintDialog();
}
/// <summary>
/// 打印御覽
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void printPreToolStripMenuItem_Click(object sender, EventArgs e)
{
getCurrentBrowser().ShowPrintPrevIEwDialog();
}
/// < summary>
/// 關閉浏覽器
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
/// <summary>
/// 頁面設置
/// </summary>
/// <param name="sender"></param >
/// <param name="e"></param>
private void pageSetupToolStripMenuItem_Click(object sender, EventArgs e)
{
getCurrentBrowser().ShowPageSetupDialog();
}
/// < summary>
/// 屬性設置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void propeToolStripMenuItem_Click(object sender, EventArgs e)
{
getCurrentBrowser().ShowPropertIEsDialog();
}
#region//關 於
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
AboutBox1 myabout = new AboutBox1();
myabout.Show();
}
private void tipToolStripMenuItem_Click (object sender, EventArgs e)
{
MessageBox.Show("小提 示:雙擊分頁標題即可關閉當前頁面。");
}
#endregion
#endregion
說明:其中文件菜單的功能大都是WebBrowser控件 封裝好的僅僅是用上文提到的getCurrentBrowser()獲取一下當前浏覽器罷了。