Hello Everyone,
We have a production WinForms Application that uses a WebBrowser to display
readonly data. In the html document we have SPAN elements that facilitate
menu selections. We also have a TABLE object that is bound to an XML Data
Island, each row of the table has an option to "View Details" or "Delete"
When a user clicks a SPAN object we would set the WebBrowser's Status Text
to the desired command, then back to "Ready". The windows form would then
capture the statustext change event and process the command. We were
testing the impact IE7 has with this application and found that this
solution no longer works.
We have now decided to listen for the click events of these SPAN objects
from within the windows form. This is working wonderful except for the SPAN
objects in the databound table. Here in lies my question, how do we get the
click events to fire in our windows form?
Below is a snippet of code that we use to add the event handler, first for
the top level menu items, then for the menu items on each row of the table.
For Each objElement As HtmlElement In
objHTML.All.Item("menusection").GetElementsByTagNa me("SPAN")
'Top level menu Items are seperated with " | ", so ignore them
If Not objElement.InnerText.Contains("|") Then
AddHandler objElement.Click, AddressOf MenuItemClicked
Trace.WriteLine(String.Format("{0}, {1}", objElement.TagName,
objElement.InnerText))
End If
Next
For Each objElement As HtmlElement In
objHTML.All.Item("menutable").GetElementsByTagName ("SPAN")
'The only two menu items that we want to listen for are "Delete" and
"View Details"
If objElement.InnerText.Contains("Delete") Or
objElement.InnerText.Contains("View Details") Then
AddHandler objElement.Click, AddressOf MenuItemClicked
Trace.WriteLine(String.Format("{0}, {1}", objElement.TagName,
objElement.InnerText))
End If
Next
Thanks in advance 1 2471
Bump
"AMDRIT" <am****@hotmail.comwrote in message
news:Og****************@TK2MSFTNGP04.phx.gbl...
Hello Everyone,
We have a production WinForms Application that uses a WebBrowser to
display readonly data. In the html document we have SPAN elements that
facilitate menu selections. We also have a TABLE object that is bound to
an XML Data Island, each row of the table has an option to "View Details"
or "Delete"
When a user clicks a SPAN object we would set the WebBrowser's Status Text
to the desired command, then back to "Ready". The windows form would then
capture the statustext change event and process the command. We were
testing the impact IE7 has with this application and found that this
solution no longer works.
We have now decided to listen for the click events of these SPAN objects
from within the windows form. This is working wonderful except for the
SPAN objects in the databound table. Here in lies my question, how do we
get the click events to fire in our windows form?
Below is a snippet of code that we use to add the event handler, first for
the top level menu items, then for the menu items on each row of the
table.
For Each objElement As HtmlElement In
objHTML.All.Item("menusection").GetElementsByTagNa me("SPAN")
'Top level menu Items are seperated with " | ", so ignore them
If Not objElement.InnerText.Contains("|") Then
AddHandler objElement.Click, AddressOf MenuItemClicked
Trace.WriteLine(String.Format("{0}, {1}", objElement.TagName,
objElement.InnerText))
End If
Next
For Each objElement As HtmlElement In
objHTML.All.Item("menutable").GetElementsByTagName ("SPAN")
'The only two menu items that we want to listen for are "Delete"
and "View Details"
If objElement.InnerText.Contains("Delete") Or
objElement.InnerText.Contains("View Details") Then
AddHandler objElement.Click, AddressOf MenuItemClicked
Trace.WriteLine(String.Format("{0}, {1}", objElement.TagName,
objElement.InnerText))
End If
Next
Thanks in advance This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jason Keirstead |
last post by:
Is there a way I can add a setter/getter to the HTMLElement prototype
in internet explorer?
This, for example, works fine in Mozilla:
HTMLElement.prototype.__defineSetter__("foobar", function...
|
by: Tim Haughton |
last post by:
I've just released an article on using Test Driven Development with C# and
Windows Forms. GUI's are often difficult to test, so I thought it might be
of interest.
The article along with the...
|
by: RAJ |
last post by:
hi
plz tell me how to know "how window is going to close"...
i have to right code for X button of forms...
plz telll me
thanks
bye
|
by: Empire City |
last post by:
I have a screen:
Email address: ------------
Name: --------------
Phone: ----------------
Add, Change, Delete, Cancel, Exit
When the user enters the email address and hits TAB in the...
|
by: Scott |
last post by:
I have written windows applications using MFC for several years and
have frequently used MFC techniques.
Now I'm moving to C# .NET WinForm. Mostly C# books describes C#
language (sometimes...
|
by: RL Stevenson |
last post by:
What is a reasonable way to manage a complex form with 5 or so tabs with 100
or more controls bound to 5-10 tables in a database?
Pasting all those controls, datasets, data adapters directly onto...
|
by: bsturg21 |
last post by:
Hello,
I have a windows form that has a series of linklabels on it, and I
need to have each linklabel, when clicked, open a separate windows
form that has a single paramter passed into it. The...
|
by: raylopez99 |
last post by:
Keywords: scope resolution, passing classes between parent and child
forms, parameter constructor method, normal constructor, default
constructor, forward reference, sharing classes between forms....
|
by: marchaos |
last post by:
I'm trying to override the native HTMLElement.addEventListener in
firefox so that I can do some extra things. I know it's possible to
add methods to the HTMLElement prototype and for them to be...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: lllomh |
last post by:
How does React native implement an English player?
| |