473,386 Members | 1,798 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,386 software developers and data experts.

WebBrowser - VBScript Issues

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 - plus some
buttons to dynamically resize the image.

I have gotten almost everything to work - I put in a function to
simply disable the right-click option of the browser, but none of the
other functions work.

If I copy the source data out of the WebBrowser control and open it in
IE6 - everything works as it is supposed to, but not within the
WebBrowser as an object in VB6...

Obviously the control supports vbscript because the right-click works.

Any ideas on what I am doing wrong:

<html>
<head>
<title>C4P Image</title>
<SCRIPT type ="text/vbscript">
<!--
Option Explicit
dim myWidth, myHeight

Sub Startup()
myWidth = Document.forms("myForm").All.item("imgTarget").wid th
myHeight = Document.forms("myForm").All.item("imgTarget").hei ght
End Sub

Sub cmdShrink_OnClick()
Document.forms("myForm").All.item("imgTarget").wid th =
Document.forms("myForm").All.item("imgTarget").wid th *0.5
Document.forms("myForm").All.item("imgTarget").hei ght =
Document.forms("myForm").All.item("imgTarget").hei ght * 0.5
End Sub

Sub cmdGrow_OnClick()
Document.forms("myForm").All.item("imgTarget").wid th =
Document.forms("myForm").All.item("imgTarget").wid th *2
Document.forms("myForm").All.item("imgTarget").hei ght =
Document.forms("myForm").All.item("imgTarget").hei ght * 2
End Sub

Sub cmdReset_OnClick()
Document.forms("myForm").All.item("imgTarget").wid th = myWidth
Document.forms("myForm").All.item("imgTarget").hei ght =
myHeight
End Sub

Sub CatchMouseDown()
if Window.event.button = 2 Then
Alert("right-click off")
End If
End sub
-->
</SCRIPT>
</head>
<body onMouseDown="CatchMouseDown()" onload = "Startup" >
<form name = "myForm" >
<table CELLSPACING="0" CELLPADDING="0" VALIGN="CENTER"
WIDTH="100%" HEIGHT="100%" BORDER="0">
<tr><td align="center">
<table id="container" CELLSPACING="0" CELLPADDING="0"
VALIGN = "CENTER" WIDTH="90%" HEIGHT="90%" BORDER="0">
<tr><td>
<p align="center"><img border="0" src="picture.jpg"
loop = "infinite" width="120" height="43" name = "imgTarget"></p>
</td></td>
</table>

<p align = "center">
<input type = "button" value = "Smaller" name =
"cmdShrink" />
<input type = "button" value = "Larger" name = "cmdGrow"
/>
<input type = "button" value = "Reset" name = "cmdReset"
/>
</p>
</td></tr>
</table>
</form>
</body>
</html>
Jul 17 '05 #1
0 3454

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

Similar topics

5
by: Noozer | last post by:
I've got a WebBrowser control (AxBrowse - VCMAXB.DLL) and I'm having a few difficulties with it. Just looking for a few pointers, not whole solutions here. I've tried looking at the MSDN help files...
1
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script :...
16
by: Mike Schinkel | last post by:
Does anyone know if there are bugs in VBScript's GetRef()? I'm using VBScript Version 5.6.8515 on Win2003Server w/ASP. Sometimes it returns an object that VarType() says is a vbObject. Other...
0
by: Jim Hubbard | last post by:
I want to design my own security model using the webbrowser control. The 4 zones in IE security are just not enough to get granular with different security restrictions for each URL. Is there a...
3
by: pjglick | last post by:
I am sorry if this sounds hokey but I am a newbie to ASP. I have a VBScript running in an ASP page. The script makes a connection to Oracle via and ADODB connection. When my clients connect...
6
by: ESmith | last post by:
I'm looking to user a web browser component in VS2005. I like the functionality in the AXWebBrowser component (from ActiveX controls page) that allows me to do this: mshtml.HTMLDocument doc; ...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
7
by: Dave Booker | last post by:
I am using a WebBrowser object in my .NET 2.0 application, but it is not shown to the user. Every time a timer event triggers it to perform a m_WebBrowser.Navigate() I get that classic IE 'click'...
5
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I am having problems interacting with flash objects (i.e., Adobe Flash Player 9) in web pages when using a System.Windows.Forms.WebBrowser control. The flash objects always seem to display...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.