Click here to Skip to main content
15,900,325 members
Home / Discussions / C#
   

C#

 
QuestionI cannot establish a connection to pop3 server !!! Pin
mohadcs13-Oct-06 11:12
mohadcs13-Oct-06 11:12 
QuestionDoc File Display Pin
Syed Shahid Hussain13-Oct-06 10:58
Syed Shahid Hussain13-Oct-06 10:58 
AnswerRe: Doc File Display Pin
Nader Elshehabi13-Oct-06 12:35
Nader Elshehabi13-Oct-06 12:35 
GeneralRe: Doc File Display Pin
Syed Shahid Hussain13-Oct-06 20:38
Syed Shahid Hussain13-Oct-06 20:38 
Questioncreating prime events for a control Pin
Nadia Monalisa13-Oct-06 9:24
Nadia Monalisa13-Oct-06 9:24 
AnswerRe: creating prime events for a control Pin
Wjousts13-Oct-06 10:34
Wjousts13-Oct-06 10:34 
GeneralRe: creating prime events for a control Pin
Nadia Monalisa13-Oct-06 10:41
Nadia Monalisa13-Oct-06 10:41 
AnswerRe: creating prime events for a control Pin
Nader Elshehabi13-Oct-06 12:05
Nader Elshehabi13-Oct-06 12:05 
Hello Emran

Sure there is a way of making your own events. In your custom class declare your public event like this:
public event HtmlDocumentChange OnHtmlDocumentChange;

HtmlDocumentChange is your handler's delegate.

Then you have to fire/raise the event by calling that delegate:
OnHtmlDocumentChange();


This is the very basic principle of events. The entire issue is when to know that the document has changed thus firing the event is specific to your contorl. If you are inheriting from WebBrowser control, you'd have to handle all events that might change the document -eg. Navigated, DocumentCompleted, DocumentTitleChanged, etc..-, then check the current document against the old one somehow. Depending on the changes you want to track you can store a backup copy of the current document in a private member to compare against, or just store the part you are tracking. When you sense a change in the document call the OnHtmlDocumentChange() delegate.

PS.
Using Timers is not bad.. It's disastrous way of firing event.Smile | :)

RegardsRose | [Rose]

QuestionMonitor Browser Externally Pin
Victor M. Bello A.13-Oct-06 8:07
Victor M. Bello A.13-Oct-06 8:07 
AnswerRe: Monitor Browser Externally Pin
Victor M. Bello A.13-Oct-06 9:36
Victor M. Bello A.13-Oct-06 9:36 
AnswerRe: Monitor Browser Externally Pin
seannyc13-Oct-06 10:32
seannyc13-Oct-06 10:32 
GeneralRe: Monitor Browser Externally Pin
Victor M. Bello A.16-Oct-06 6:57
Victor M. Bello A.16-Oct-06 6:57 
QuestionKeeping track of ID information with a TreeView Pin
shultas13-Oct-06 7:41
shultas13-Oct-06 7:41 
AnswerRe: Keeping track of ID information with a TreeView Pin
mav.northwind13-Oct-06 9:18
mav.northwind13-Oct-06 9:18 
GeneralRe: Keeping track of ID information with a TreeView Pin
shultas13-Oct-06 11:45
shultas13-Oct-06 11:45 
QuestionString.Trim error Pin
User 309585913-Oct-06 7:13
User 309585913-Oct-06 7:13 
AnswerRe: String.Trim error Pin
Christian Graus13-Oct-06 7:22
protectorChristian Graus13-Oct-06 7:22 
GeneralRe: String.Trim error Pin
User 309585913-Oct-06 7:28
User 309585913-Oct-06 7:28 
AnswerRe: String.Trim error Pin
Nader Elshehabi13-Oct-06 11:54
Nader Elshehabi13-Oct-06 11:54 
GeneralRe: String.Trim error Pin
User 309585913-Oct-06 12:01
User 309585913-Oct-06 12:01 
AnswerRe: String.Trim error Pin
greyzz13-Oct-06 20:11
greyzz13-Oct-06 20:11 
QuestionMaster Card imp File Parsing Pin
Samarjit Chavan13-Oct-06 6:39
Samarjit Chavan13-Oct-06 6:39 
AnswerRe: Master Card ipm File Parsing Pin
Samarjit Chavan13-Oct-06 6:40
Samarjit Chavan13-Oct-06 6:40 
GeneralRe: Master Card ipm File Parsing Pin
WillemM13-Oct-06 9:27
WillemM13-Oct-06 9:27 
QuestionLooping through a datagrid Pin
scotlandc13-Oct-06 6:28
scotlandc13-Oct-06 6:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.