473,651 Members | 2,512 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.i tem("imgTarget" ).width
myHeight = Document.forms( "myForm").All.i tem("imgTarget" ).height
End Sub

Sub cmdShrink_OnCli ck()
Document.forms( "myForm").All.i tem("imgTarget" ).width =
Document.forms( "myForm").All.i tem("imgTarget" ).width *0.5
Document.forms( "myForm").All.i tem("imgTarget" ).height =
Document.forms( "myForm").All.i tem("imgTarget" ).height * 0.5
End Sub

Sub cmdGrow_OnClick ()
Document.forms( "myForm").All.i tem("imgTarget" ).width =
Document.forms( "myForm").All.i tem("imgTarget" ).width *2
Document.forms( "myForm").All.i tem("imgTarget" ).height =
Document.forms( "myForm").All.i tem("imgTarget" ).height * 2
End Sub

Sub cmdReset_OnClic k()
Document.forms( "myForm").All.i tem("imgTarget" ).width = myWidth
Document.forms( "myForm").All.i tem("imgTarget" ).height =
myHeight
End Sub

Sub CatchMouseDown( )
if Window.event.bu tton = 2 Then
Alert("right-click off")
End If
End sub
-->
</SCRIPT>
</head>
<body onMouseDown="Ca tchMouseDown()" 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.jp g"
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 3467

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

Similar topics

5
7547
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 with little success. - When a new window is trying to pop up, how do I determine the target URL? How can I get the page to open in the current browser control? - When printing from the webbrowser control is there a way to ensure it prints...
1
7968
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 : VBScript and Javascript Client : 1. IE browser. 2. VBForm embedded with WebBrowser control (MS Internet
16
9343
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 times it returns VarType() is vbEmpty. This is driving me mad! Also, does anyone know what the properties and methods are for the object returned by GetRef()? TIA.
0
1015
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 way to hook into and override the different actions that download and initiate/install ActiveX controls in the webbrowser control? How about for vbscript, javascript, Java applets, file downloads, etc, ? Basically I want to handle the security...
3
6043
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 to the ASP page they get Oracle client issues. How do I make the script run from the server side to eliminatew any oracle client issues or oracle tns names issues.
6
11248
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; doc = (mshtml.HTMLDocument)this.SecureWebBrowser.Document; mshtml.HTMLButtonElement ButtonTest =
12
6357
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 of course it's thrown up a whole host of new issues... I'm generating a multi page printable document in HTML from my app, and displaying it in a WebBrowser control. I've looked into using some CSS
7
11917
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' and it steals the focus from the user's current application. How can I prevent the hidden WebBrowser from stealing focus? (And better yet can I even suppress that click?_
5
12047
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 correctly, but when I click on a link within the flash object the WebBrowser often fails to navigate to the new page. If I use IE6 (from outside by app) or an AxSHDocVw.AxWebBrowser control (within my app) then everything works as expected. You can...
0
8352
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8802
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8697
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7297
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2699
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.