473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

WebBrowser: Programmaticaly click an image button

I got an image button in a form. I want to simulate a click through programming.
There is no Click method for HTMLElement. I tried el.RaiseEvent("Click")
instead and an error occured.

How can I click the image button?

For Each el In frm.All
If el.TagName.ToString = "INPUT" Then
Debug.Print(el.OuterHtml)
If el.GetAttribute("type") = "image" Then
If el.GetAttribute("Value") = "Login" Then
el.RaiseEvent("Click")
Exit For
End If
End If
End If
Next el
Jul 2 '06 #1
1 5945
Hello nime,

Well, you either click the button to submit the form.. in which case you
want to call Form.submit()... or you click the button to invoke a click handler
(<img onclick="someJSFunction()">).. in which case you call the function
direct.

-Boo
I got an image button in a form. I want to simulate a click through
programming.
There is no Click method for HTMLElement. I tried
el.RaiseEvent("Click")
instead and an error occured.
How can I click the image button?

For Each el In frm.All
If el.TagName.ToString = "INPUT" Then
Debug.Print(el.OuterHtml)
If el.GetAttribute("type") = "image" Then
If el.GetAttribute("Value") = "Login"
Then
el.RaiseEvent("Click")
Exit For
End If
End If
End If
Next el

Jul 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Trevor Fairchild | last post by:
I'm trying to have VB6 write an html file during run-time, with some VBScript functionality. The intent is to display images based on the current record within the program - using a WebBrowser -...
1
by: Matt | last post by:
Hi group, Here's a problem I've been trying to solve for the past several weeks. I have the standard WebBrowser object added to a form so it can access websites, and I have it load a default...
0
by: Debbie | last post by:
I have a webbrowser on a form with a mshtml document. Ive added toolbar buttons for setting bold etc and this all works. The problem is the extra buttons i added. Just standard buttons. But...
11
by: cindy | last post by:
I have a form, has javascript registered so a modal pops up. Button click will close form. Now I need to do an update with modal form data before it closes. I can put a second button and register...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
3
by: Webnewsreader | last post by:
Hi,I have a webbrowser object with two frames with similar source code<frameset cols="230,*"> <frame name="frame1" target="frm1" src="teste1.php?var=123"> <frame name="frame2" target="_blank"...
0
by: Boki | last post by:
Hi All, I am programming a message robot to Yahoo somewhere. I found it is impossible to leave a message directly. because 1. There are 2 security keys need to fit, the key only come with...
3
by: =?Utf-8?B?TWFya19C?= | last post by:
I recognize that this question has a substantial Java component and I have cross posted it on Sun’s website. But it is a problem of interface with VS.NET and I suspect they will angrily redirect...
1
by: heyi | last post by:
hi, i'm making an app which uses a webbrowser control to show some offline (not cache) html pages like a slide show. let's say pages in a folder on the desktop etc... when it came to testing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.