Stop Dragging Links From Webbrowser Control
Hi all, i'm creating a securelink browser application using WebBrowser cotrol in VB6. Our requirment is that no one can't do drag and drop a hyperlink out side the application ,as one can do with other browsers. so how can i do this ,plz help me.
Thanks
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Extracting Links Within A Webbrowser Control
I have a webbrowser control that navigates to a page on an online game (http://www.outwar.com/rankings.php?t...=400&submit=go) and i want to be able to extract all the player names and links on that. I think i could probably use the inet control to get the source code and parse it, but that would take me damn well near the rest of my life to do, so im wondering if i can get the links and names off using the webbrowser control and add them to a listbox.
Webbrowser Control (how To Retrieve Links)
I am using the webbrowser control in VB. I was wondering if there is any "trick" for visualising, or somehow retrieving all the links from the actual web page? And by links I don't mean the content, but only the url itself, of course.
I thought about making a loop, sending the TAB key with the sendkeys function and look at the statustext variable.
Any better solutions?
Amazing Problem. I Cant Get Links From Webbrowser Control When My Program Is Compiled
Hello,
I am trying to retrieve all the links from a web page. I am using webbrowser control for that. I create references of the Microsoft HTML Object library. I used 3 methods. And all of them works fine when i run the program within visual basic code window. But as soon as i create .exe it does not work and show me the error 'Object variable of with block variable not set' (error : 91)
Here is my code.
Method 1:
Code:
Dim doc as New HTMLDOCUMENT
Dim a_link As HTMLAnchorElement
wbrsource.navigate("www.bdlearner.qsh.es")
'Give time to webbrowser for loading document
do while wbrsource.readystate<>readystate_complete
doevents
loop
'Document loading completed. Extract links
Set doc = wbrSource.Document
Set a_link = doc.links
For Each a_link In doc.links
List1.AddItem a_link.href
Next a_link
Method 2:
Code:
dim collinks as variant
wbrsource.navigate("www.bdlearner.qsh.es")
'Give time to webbrowser for loading document
do while wbrsource.readystate<>readystate_complete
doevents
loop
'Document loading completed. Extract links
Set collinks = wbrSource.Document.All.tags("A")
For qq = 0 To collinks.Length - 1
List1.AddItem collinks(qq).href
Next qq
Method 3:
Code:
wbrsource.navigate("www.bdlearner.qsh.es")
'Give time to webbrowser for loading document
do while wbrsource.readystate<>readystate_complete
doevents
loop
'Document loading completed. Extract links
For qq = 0 To wbrSource.Document.links.Length - 1
List1.AddItem wbrSource.Document.links(qq).href
Next qq
I tried all 3 methods. But none works when the code is compiled into .exe.
What can i do now? I need a solution. I am using Microsoft Internet Explorer (Version: 6.0.2900.2180.xpsp_sp2_rtm.040803-2158)
Please help me.
Kindest regards...
Shaoun
How To Stop WebBrowser Control To Resize Itself
Hi !
I have a lil program that has a webbrowser and sometimes I surf to webpages that have the script to resize my browser window to be full screen or reduced, so it makes my webbrowser the size of my form....arg!! how can i disable this autoresize so that when it tries to resize my webbrowser, it will either not do anything or go back to teh original size??
Here is an example of a site that resize the WebBrowser control:
http://www.smalltiger.com/unverredeplus/enter.htm
Thank
Restrict Dragging Of Links From Web Browser To Desktop
I have developed a customized web browser and want to prevent users from dragging hyperlinks(URLs) from the browser to outside (explorer, any other application. etc..)
I have developed the browser using the microsoft internet control component in Visual Basic 6.0
Ex-
when a user drag and drop a link to the desktop then it creates a shortcut of that URL.
Since I am developing a secure browser, so I want to remove the drag and drop functionality from the web browser.
Please provide me with an optimum solution as soon as possible.
How To Stop Auto Resize In Webbrowser Control
i have a lil program that has a webbrowser and soemtimes i surf to webpages that have the script to resize my browser window to be full screen, so it makes my webbrowser the size of my form....arg!! how can i disable this autoresize so that when it tries to resize my webbrowser, it will either not do anything or go back to teh original size??
Stop Webbrowser Control From Taking Windows Focus
i have a web browser control on my form and every time it does something the window its in get brought to the front of the screen even if the user has it minimized or in the back. Is there any way to stop this?
Stop The Dragging...?
Here's what I have:
- A label control array within a picturebox. The label control array
- can be dragged left and right from one end of the picturebox
- to the other. The problem is that the control array can also
- be dragged past either end of the picturebox, making the label
- control array not usable.
Here's what I need:
- To be able to have the label control array stop from being
- dragged. In other words, have a left and right limit as to how
- far the control array can be dragged.
The way I'm doing it now.....doesn't work.
Any ideas welcome...
Stop Form From Dragging Off-Screen
I've searched this quite a bit and keep coming up with the same results... all of which don't really solve the problem...
I have a form that I want users to drag, however, I do not want the form to cross the edges of the screen. That is, I do not want any part of the form to disappear outside the screen. The only code I've found close to this is one to snap the form to the edge of the screen (while still allowing it to be pushed outside the screen).
I've tried using the mouse position API for the form, but it doesn't capture the X and Y coordinates for when you're over the form's border. I understand this to only see the INSIDE of the form, and not the form's border included.
Thanks in advance!
Stop Title Bar Mouse Dragging
Hello Folks,
i am new to this forum but i have a problem which i have researched but failed.
I have disabled my applications titlebar,maximise button. But the title bar actually docks itself in a restored state and yet i wanted it maximised so that no one would drag it over the screen as this happens when its in a restored state.
How can i be able to disable the Mouse Click move titlebar(or application window) action.
Thanks in advance.
Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!
thanks!
Excel 200, Stop Links Message & Update.
I have a spreadsheet with links to an external source. Is it possible to not display the Update Links message on Opening and to Not update the links.
I have seen code to turn off the Update links message but this then automatically updates the links which is no good.
The spreadsheet is being sent to people who won't have access to the base information, so will delete all data if user presses wrong button etc.
Don't think this is possible but any help given is much appreciated.
Regards.
rob.
Prevent Dragging From Webbrowser
Hi,
I am using a webbrowser control to display a page, and I'm looking for a way to prevent the user from being able to drag a link/picture etc. from the webbrowser control to somewhere else (eg. desktop).
I searched through the forum and Kzin asked a similar question back in 2002, but didn't get an answer.
Anyone got any ideas?
Cheers,
Nap
Stop A Webbrowser Control From &"clicking&"
hi guys
does anybody know if theres a way to stop the a microsoft internet control (web browser) from making that clicking sound every time it refreshes/loads a page?
alternately, is there a way to get the HTML source of a webpage WITHOUT using any extra ocx's that the user of my program may not have?
a module perhaps?
thanks!
Links > Webbrowser?
You know how when you drag over a link in IE and it tells you the webpage on the status bar. Well I was wondering how I could get a label to do that?
WebBrowser Links Opening
Instead of clicking on a link in the browser and it opening the page, can you click on a link that will send the link name to a specific text box? Does someone have an example they can show me?
Thanks for help
[Not Resolved] Webbrowser Links?
Hi guys.... I searched the forum but I didn't find the answer... So I post this question: How can I extract all the links in a webbrowser when the HTML page has frames?
I tried to look at Webbrowser.Document.Links.Length but it returns zero, and I can't find a way to access the same property in the frames!!!
Thanks,
Xmas.
Collecting And Listing All Links In Webbrowser
How could I list all links that are on the page into List1?
List1.AddItem WebBrowser1.Document.links ' This grabs the first link
Text1.Text = WebBrowser1.Document.links ' This lists ALL links, even the logout one which is undesired...
How can I gather several specific links?
Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y
For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);
var w = elem.offsetWidth;
var h = elem.offsetHeight;
var l = 0;
var t = 0;
while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}
return {"left":l, "top":t, "width": w, "height":h};
}
Trying by vb6 in webbrowser
Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document
For x = 0 To doc.getElementsByTagName("a").length - 1
Set elem = doc.getElementsByTagName("a")(x)
I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id
To while loop, but I can't figure it out how
While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend
Next x
Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y
For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);
var w = elem.offsetWidth;
var h = elem.offsetHeight;
var l = 0;
var t = 0;
while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}
return {"left":l, "top":t, "width": w, "height":h};
}
Trying by vb6 in webbrowser
Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document
For x = 0 To doc.getElementsByTagName("a").length - 1
Set elem = doc.getElementsByTagName("a")(x)
I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id
To while loop, but I can't figure it out how
While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend
Next x
How Can You Get A List Of Images On A Webpage, With Their Links In A Webbrowser Ctrl?
In a webbrowser control, you can get a list of all links by the code
VB Code:
For x = 0 to WB.Document.links.length - 1msgbox WB.Document.Links(x).srcNext
and you can get a list of images with
VB Code:
For x = 0 to WB.Document.images.length - 1msgbox WB.Document.images(x).srcNext
but how can you get a list of images and the links they link to (if any?)
Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y
For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);
var w = elem.offsetWidth;
var h = elem.offsetHeight;
var l = 0;
var t = 0;
while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}
return {"left":l, "top":t, "width": w, "height":h};
}
Trying by vb6 in webbrowser
Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document
For x = 0 To doc.getElementsByTagName("a").length - 1
Set elem = doc.getElementsByTagName("a")(x)
I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id
To while loop, but I can't figure it out how
While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend
Next x
Stop Webbrowser Pop-ups
hi
i have webbrowser on a form, and i navigate to a link. I want to stop ANY pop-ups that may appear.
Anybody has any ideas...?
Thanx in advance
WebBrowser.Stop!
In a WebBrowser project, I have this simple code in the Click event function of a Picture to stop the browser from downloading the entire web page:
VB Code:
Private Sub picStop_Click() picStop.Picture = LoadPicture(App.Path & "ImagesStop2.gif") Me.wWeb.Stop 'sbrWeb is the StatusBar sbrWeb.SimpleText = "Done"End Sub
Note that pressing the Esc key on the keyboard will also stop the page from downloading.
Now what is happening is if a web page has lots of graphics & textual content (thereby taking more time to download), if the Picture is clicked (or Esc is pressed) to halt the download, the browser hangs for around 40-50 seconds.
First of all, what's causing the browser to hang & secondly, how do I avoid that?
Webbrowser Stop Flash Or Sound
Hey, quick question. I know it's been asked before because I searched, but I never really found a straight answer that worked, so I hope you guys don't get pissed for me re-asking.
I have a vb6 program that uses webbrowser to visit a web page similar to youtube (Plays .flv files and such). The thing is, I want to listen to music while the program is running, so can I either
A) Mute the sound of just the webbrowser or just that program. I don't care about the click sounds or whatever, I just don't want those flv videos to play the sound.
or
B) Can I somehow disable flash just for that instance of IE? I don't want this to affect IE on my entire comp, but just for my program. I realize that the movies won't play, but that doesn't matter. I just need the flash not to load so that the sounds won't play from the movies.
Any help would be appreciated. Also, if you know of a creative way to solve the issue other than the choices I have thought of, feel free to post that too.
Thanks in advance,
-Greatness
Stop Going Back In A Webbrowser If On Last Page?
im making a webbrowser just for the fun of it, and i'm having a problem.
if the user clicks back when the browser cant go back no more as there are no more pages before the one they are on, or forwards as they cant to forwards anymore, they get an error.. how to i remedy this so they cant click the back and forwards buttons when they cant go back or forwads?
How To Stop The Sound Webbrowser Produces
I have a webbrowser control which I use to navigate by clicking (by code) some links. The webbrowser control is using InternetExplorer and InternetExplorer produces a "click" sound when we click on a link or a button.
How can I avoid that? I just need it to be silenced.
Stop The WebBrowser From Downloading The Graphics, ...
How can I stop the WebBrowser from downloading the graphics, Java classes, etc? I just need the text but as a Document object so I can eazy access its tags.
Or, which is the best way to get the "Document" object from a URL so I can access the TAGS? Can this be done without using the webbrowser control?
If I use the Inet control to get the source how can I build the Document object?
ThanX.
Dragging In Tab Control
He,
I need to have the capability to switch between tabs by dragging the tab to the desired location.
I don't have any idea how to do it !
Any idea will be really helpfull
Thanks
Sigal
Stop Media Player & Switch To WebBrowser
I have a program which I want to open with an avi video. I want to be able to stop the media player at any time by clicking on Command button 7 or Command button 4 (each will open a separate web page).
Problem right now is when the program runs, when I click on the Command buttons the media player continues to play and I can't view the webbrowser. I know this is a simple question, but you guys are my tutors!
Also, any suggestions you have for making this better I'd appreciate.
Sub List()
Private Sub Form_Load()
MediaPlayer1.FileName = "http://mywebsite.edu/aearly/movies/mpa1.avi"
End Sub
Private Sub Command7_Click()
Call WebBrowser1.Navigate("http://www.nku.edu/~mpa/")
End Sub
Private Sub Command4_Click()
Call WebBrowser1.Navigate("http://www.nku.edu/~gradprog/graduate_application.pdf")
End Sub
Private Sub Command2_Click()
MediaPlayer1.FileName = "http://mywebsite.edu/aearly/movies/mpa1.avi"
End Sub
Dragging A Control Along With Your Program
Is there a way to have your program carry a SysInfo control on its back? So that when I copy my program into another computer (it's a USB key backup program) it doesn't cause an error when it can't find the control?
Dragging And Dropping Control?
I am coding to move the control panel around where I wanted to by dragging it. It doesn't move right. anyone can help?
Private xoffset as single, yoffset as single
Private Sub pnTT_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
xoffset = X
yoffset = Y
pnTT.Drag vbBeginDrag
End Sub
Private Sub pnTT_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
xoffset = 0
yoffset = 0
End Sub
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move X - xoffset, Y - yoffset
End Sub
I am really aprreciate your help.
Dragging A Shape Control
I've been working on a class that will allow me to draw a rectangle on a form and then be able to stretch it by dragging the sides or corners. (Eventually I plan on incorporating it in my Picture Viewer app so that I can crop pictures.) I've run into a problem that has had me stumped for two days and maybe some fresh eyes will find it.
To reproduce the problem, run the app and draw a rectangle on form by clicking the mouse and dragging it. When you do that the rectangle will be drawn very smoothly by dragging its lower right-hand corner. Now release the mouse and move it over the edges of the rectangle and you'll see that "grab handles" appear. So far so good, but now move the mouse to the lower right-hand corner so that the "northwest" grab handle appears there and attempt to drag that corner. The problem is that while you can do it slowly for a while the mouse will eventually "jump off" the rectangle without the mouse_up event having been fired. Note that both the DrawInitial procedure that is used to initially draw the rectangle and the Stretch procedure that is used to stretch it after it's drawn both use the same StretchFromBottomRight procedure so I really don't understand why it doesn't work the same both times.
Dragging An Image Control
Hi Guys
I wish to know how best can i facilitate moving of an Image control at runtime by dragging throug a mouse (with little or no flickering at all).
Regards
Suhaib
How Can You Get A Webbrowser To Navigate To A Page, Then Make It Stop Immideately?
WB.Navigate "http://www.vbforums.com"
do:doevents:loop until wb.readystate = 3 or wb.readystate = 4
wb.stop
thats what im using now - it works, but it uses 100% cpu, and its not good for multithreading
i have 5 timers, each of them with interval 1 and each of them have this code:
if wb.readystate = 3 or wb.readystate = 4 then
wb.stop
wb(x).navigate "http://www.vbforums.com"
end if
and this way, i can 'multithread'. however, this causes the webbrowser to use a lot of cpu and resources..
is there anyway to simply stop the browser with a better method than what im using?
wb.navigate site
wb.stop
will not work, as the browser must be properly initialized..
i know it sound strange, but does anyone know?
Dragging Control - Keep Inside It's Container?
Hi,
I have an image control inside a picturebox. So the picturebox is the image controls container.
I can move the image control about inside the picturebox just fine, but I would like to restrict it to the boundary of the picturebox. I can do this but when you drag the image control up against one of the picturebox's borders the image begins to shake and flash.
So what I'm asking is how can I make it remain solid when it's up against the picturebox's border? I'm sure it's something simple, but I just can't seem to think of a way. :/ I attached an example project.
Problem With ListView Control And Dragging
I'm trying to drag an item from one ListView control to another but whenever I click on any of the items the first item is selected no matter which I have clicked on. The drag outline does appear over the selected object though. The ListView control is in report view and all the other relevant code is below, can anyone suggest what I've done wrong?
Many thanks
Geoff
Setting up control:
Dim itmX As ListItem
lsvEvents.ListItems.Clear
lsvEvents.ColumnHeaders.Clear
lsvEvents.ColumnHeaders.Add , "Event", "Event", lsvEvents.Width / 2
lsvEvents.ColumnHeaders.Add , "Time", "Time", lsvEvents.Width / 2
lsvEvents.SmallIcons = imlLog
For each record in a recordset:
Set itmX = lsvEvents.ListItems.Add()
itmX.Text = !Name
itmX.Tag = !EventID
itmX.SubItems(1) = !OpenTime
Select Case !EventType
Case Is = "<Project File>"
itmX.SmallIcon = "Project"
Case Is = "<Resource File>"
itmX.SmallIcon = "Resource"
Case Is = "<Issue>"
itmX.SmallIcon = "Issue"
End Select
MouseDown:
Private Sub lstEvents_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim DY ' Declare variable.
DY = TextHeight("A") ' Get height of one line.
lblDrag.Move lstEvents.Left, lstEvents.Top + y - DY / 2, lstEvents.Width,
DY
lblDrag.Drag ' Drag label outline.
End Sub
Problem With ListView Control And Dragging
I'm trying to drag an item from one ListView control to another but whenever I click on any of the items the first item is selected no matter which I
have clicked on. The drag outline does appear over the selected object though. The ListView control is in report view and all the other relevant code is below, can anyone suggest what I've done wrong?
Many thanks
Geoff
Setting up control:
Dim itmX As ListItem
lsvEvents.ListItems.Clear
lsvEvents.ColumnHeaders.Clear
lsvEvents.ColumnHeaders.Add , "Event", "Event", lsvEvents.Width / 2
lsvEvents.ColumnHeaders.Add , "Time", "Time", lsvEvents.Width / 2
lsvEvents.SmallIcons = imlLog
For each record in a recordset:
Set itmX = lsvEvents.ListItems.Add()
itmX.Text = !Name
itmX.Tag = !EventID
itmX.SubItems(1) = !OpenTime
Select Case !EventType
Case Is = "<Project File>"
itmX.SmallIcon = "Project"
Case Is = "<Resource File>"
itmX.SmallIcon = "Resource"
Case Is = "<Issue>"
itmX.SmallIcon = "Issue"
End Select
MouseDown:
Private Sub lstEvents_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim DY ' Declare variable.
DY = TextHeight("A") ' Get height of one line.
lblDrag.Move lstEvents.Left, lstEvents.Top + y - DY / 2, lstEvents.Width,
DY
lblDrag.Drag ' Drag label outline.
End Sub
|