Click here to Skip to main content
16,005,178 members
Home / Discussions / C#
   

C#

 
GeneralI've a little doubt about decimal fraction !! Pin
ElJerry18-Mar-04 12:07
ElJerry18-Mar-04 12:07 
GeneralRe: I've a little doubt about decimal fraction !! Pin
Christian Graus18-Mar-04 12:36
protectorChristian Graus18-Mar-04 12:36 
GeneralRe: I've a little doubt about decimal fraction !! Pin
Werdna18-Mar-04 16:13
Werdna18-Mar-04 16:13 
GeneralaxWebBrowser DocumentComplete Pin
Jasper4C#18-Mar-04 10:57
Jasper4C#18-Mar-04 10:57 
GeneralRe: axWebBrowser DocumentComplete Pin
John Fisher18-Mar-04 11:35
John Fisher18-Mar-04 11:35 
GeneralRe: axWebBrowser DocumentComplete Pin
Jasper4C#25-Mar-04 11:05
Jasper4C#25-Mar-04 11:05 
GeneralRe: axWebBrowser DocumentComplete Pin
John Fisher25-Mar-04 13:11
John Fisher25-Mar-04 13:11 
GeneralRe: axWebBrowser DocumentComplete Pin
Jasper4C#25-Mar-04 22:54
Jasper4C#25-Mar-04 22:54 
Here you go the full (almost) source code
<br />
//Web browser settings<br />
this.webBrowser.AddressBar = false;<br />
this.webBrowser.Dock = DockStyle.Fill;<br />
this.webBrowser.FullScreen = true;<br />
this.webBrowser.MenuBar = false;<br />
this.webBrowser.Offline = false;<br />
this.webBrowser.RegisterAsBrowser = true;<br />
this.webBrowser.RegisterAsDropTarget = false;<br />
this.webBrowser.Silent = true;<br />
this.webBrowser.StatusBar = false;<br />
this.webBrowser.TheaterMode = true;<br />
.<br />
.<br />
.<br />
	<br />
<br />
<br />
private void webBrowser_DocumentComplete (object sender,AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)<br />
{<br />
	//Test counter - to see how many times this event rised<br />
	++this.tempCounter;<br />
<br />
	if ( sender.Equals((object)this.webBrowser) && this.webBrowser.ReadyState.Equals(SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE))<br />
	{<br />
	MessageBox.Show ("Done loading\n\nLoaded " + this.tempCounter.ToString() +" times", "Document loaded");<br />
<br />
        //Receive global Document<br />
	htmlDocGlobal = (mshtml.IHTMLDocument2) webBrowser.Document;<br />
<br />
	if (clickEvent == null)<br />
	{<br />
	  //Hook the event if not hooked till now <br />
         clickEvent = (mshtml.HTMLDocumentEvents2_Event) htmlDocGlobal;<br />
         clickEvent.onclick += new mshtml.HTMLDocumentEvents2_onclickEventHandler (On_MouseClick);<br />
	}<br />
       }<br />
       //else<br />
       // { still loading }<br />
}<br />
<br />
<br />
//This function will rise when the user click's on web browser web page<br />
private bool On_MouseClick (mshtml.IHTMLEventObj e)<br />
{<br />
	if (e.button.Equals (0))<br />
	{<br />
        	//Left-click mouse<br />
<br />
	ArrayList m_PathToElement = new ArrayList();<br />
	IHTMLElement m_Parent = null;<br />
	IHTMLElement m_Child = null;<br />
	IHTMLElementCollection m_ParentCol = null;<br />
	IEnumerator colEnum = null;<br />
<br />
	//Receive pre-conditions<br />
	m_Child = e.srcElement;<br />
	//TEST_DEBUG: Child element may not have Parent elements !!!<br />
	m_Parent = m_Child.parentElement;<br />
		<br />
        while (m_Child.parentElement != null)	//if this is not the root element<br />
	{		{<br />
        	//Get the collection<br />
		m_ParentCol = (IHTMLElementCollection) m_Parent.all;<br />
<br />
		System.Windows.Forms.Application.DoEvents ();  //let the system copy it<br />
		colEnum = m_ParentCol.GetEnumerator ();<br />
		colEnum.MoveNext ();	//reset to '0'<br />
		.<br />
		.<br />
		.<br />
		.<br />
		.<br />
	Then I go throught collection and search for ckicked element till the root element.<br />
        }<br />
	}<br />
    }<br />

I make some checks for received htmlDocGlobal and the size is different all the time Cry | :((

If you need the full source code please contact me by eMail

"I have not failed.
I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
GeneralRe: axWebBrowser DocumentComplete Pin
John Fisher26-Mar-04 5:20
John Fisher26-Mar-04 5:20 
GeneralRe: axWebBrowser DocumentComplete Pin
Jasper4C#26-Mar-04 7:12
Jasper4C#26-Mar-04 7:12 
GeneralRe: axWebBrowser DocumentComplete Pin
John Fisher26-Mar-04 15:08
John Fisher26-Mar-04 15:08 
GeneralControl Confussion Pin
Matthew Hazlett18-Mar-04 10:27
Matthew Hazlett18-Mar-04 10:27 
GeneralRe: Control Confussion Pin
John Fisher18-Mar-04 10:38
John Fisher18-Mar-04 10:38 
GeneralRe: Control Confussion Pin
Heath Stewart18-Mar-04 13:41
protectorHeath Stewart18-Mar-04 13:41 
GeneralProblems with changing a controls Docking Programmatically Pin
Gomac18-Mar-04 9:47
Gomac18-Mar-04 9:47 
GeneralRe: Problems with changing a controls Docking Programmatically Pin
Heath Stewart18-Mar-04 10:06
protectorHeath Stewart18-Mar-04 10:06 
GeneralRe: Problems with changing a controls Docking Programmatically Pin
John Fisher18-Mar-04 10:06
John Fisher18-Mar-04 10:06 
GeneralRe: Problems with changing a controls Docking Programmatically Pin
Gomac23-Mar-04 8:23
Gomac23-Mar-04 8:23 
GeneralC++ parent for a C# form Pin
Member 87320118-Mar-04 9:42
Member 87320118-Mar-04 9:42 
GeneralRe: C++ parent for a C# form Pin
Christian Graus18-Mar-04 9:53
protectorChristian Graus18-Mar-04 9:53 
GeneralRe: C++ parent for a C# form Pin
Member 87320118-Mar-04 9:58
Member 87320118-Mar-04 9:58 
GeneralRe: C++ parent for a C# form Pin
Heath Stewart18-Mar-04 10:08
protectorHeath Stewart18-Mar-04 10:08 
GeneralRe: C++ parent for a C# form Pin
Heath Stewart18-Mar-04 9:58
protectorHeath Stewart18-Mar-04 9:58 
GeneralRe: C++ parent for a C# form Pin
Member 87320118-Mar-04 10:11
Member 87320118-Mar-04 10:11 
GeneralRe: C++ parent for a C# form Pin
Member 87320119-Mar-04 8:36
Member 87320119-Mar-04 8:36 

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.