TestApi – a library of Test APIs

TestApi – a library of Test APIs

TestApi is…

TestApi is a library of test and utility APIs that enables developers and testers to create testing tools and automated tests for .NET and Win32 applications. TestApi provides a set of common test building blocks — types, data-structures and algorithms — in a simple, layered, componentized and documented stack.

Get started

Capture MouseClick or MouseDown event in WebBrowser Control

Capture MouseClick or MouseDown event in WebBrowser Control

Found a solution to this issue.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace WebBrowserTest

{

 public partial class Form1 : Form

{

HtmlDocument htmlDoc;

public Form1()

{

InitializeComponent();

}

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)

{

if (webBrowser1.Document != null)

{

htmlDoc = webBrowser1.Document;

htmlDoc.Click += htmlDoc_Click;

htmlDoc.MouseDown += htmlDoc_MouseDown;

htmlDoc.MouseMove += htmlDoc_MouseMove;

htmlDoc.ContextMenuShowing += htmlDoc_ContextMenuShowing;

}

}

void htmlDoc_ContextMenuShowing(object sender, HtmlElementEventArgs e)

{

// stop the right mouse Menu

e.ReturnValue = false;

}

void htmlDoc_MouseMove(object sender, HtmlElementEventArgs e)

{

Console.WriteLine(“Mouse Move");

}

void htmlDoc_MouseDown(object sender, HtmlElementEventArgs e)

{

Console.WriteLine(“Mouse Down");

}

void htmlDoc_Click(object sender, HtmlElementEventArgs e)

{

Console.WriteLine(“Mouse Click");

// stop mouse events moving on to the HTML doc

e.ReturnValue = false;

}

}

}

 

快快丟掉ASP遺留的二十大陳舊習慣

快快丟掉ASP遺留的二十大陳舊習慣 @ King的幸福國度 :: 痞客邦 PIXNET ::

在技術更新的進程中, 仍然有一些人死抱著已經過了氣的東西不放. 也有一些人雖然進入到新的世界, 但仍擺脫不了陳舊的習慣. 我沒有用”陋習”這個詞, 因為我對這個詞也非常反感.  
新技術應該有新技術的 做法, 進入ASP.NET的世界, 就應該把以往的習慣改正, 全新的進入新的世界, 把ASP的破爛扔掉.  
以下列舉的都是錯誤的做法, 請不要誤以為是推薦的做法而進行推廣:

1. 使用server side include給ASPX引入共同的頁面構圖.
在ASP.NET的機制下, 應使用ASCX(web user control)來實現. ASCX提供了更多可控制介面. 並且更重要的是, ASCX是一個類. 一個實實在在的類. 可以全面控制它.