|
-
September 17th, 2003, 05:51 AM
#1
Adding entry to HTML Listbox
Hi
I have a webbrowser control, that among things within the HTML page, contains a listbox.
I need to be able to add entries to the listbox directly from VB. The user can add their own entries via the HTML buttons I have provided, but how can I interface the HTML to (dynamically) add entries to an otherwise empty list???
Many thanks
-
September 17th, 2003, 03:07 PM
#2
Add a tag to the html like <insert the tags here>
The web browser will ig nore it.
At the time of viewing, use a replace function to
change the <insert the tags here>, tag
with html code the user had specified.
just one way.
-
September 18th, 2003, 03:44 AM
#3
Thank you - but...
The HTML file would be constructed by the app previously, and dynamically.
It is then necessery to populate an empty list box at a later stage, so by the nature of this design, the list can't be created at 'creation of HTML' time, and has to be, as said above, dynamically 'added'. Easy to achieve in Javascript, but from VB.. a bit tougher.
I basically have to find the correct 'path' to the HTML object, so something along these lines:
mform.qform.Document.query.elements(9).Options.Add("text", 2)
-
September 18th, 2003, 04:42 AM
#4
Solved...
Basically I create a javascript function which is coded in the HTML page.. then VB can call the script:
Call mainform.qform.Document.parentwindow.execScript("addentry(1,'test')", "JavaScript")
I just never realised you could call scripts ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|