I have a large project in Vb.net which drives a web browser control around. What's the best, and easiest, way to manage browser pop ups? Note, I am not just looking to cancel or close them. I need to manage them just like the main window.
I'm trying to handle browser popups using the NewWindow event of the WebBrowser control. The one main thing I needed is the cookie from the main browser control on my form to be passed to the popup window. Below is the only way I've been able to open the popup and pass the Document.Window.Opener value to it so that when java script is executed, it knows where the opener window is. I am getting the following error right now when trying to set the cookie from my webbrowser control to the iexplore instance of the popup window that opened.
I have made a simple web browser in VB Express 2008 that goes to www.metvuw.co.nz for weather viewing. The problem is when you click on a link to show a picture (it is not just a picture it is a html page) of the weather it opens up in a new window in IE, is it possible to have it just open in the same window (in my browser) and use the back button to go back to the previous page? Ie just like when you click a normal link that doesn't open up a new tab or window.
My help files have a lot of image maps which link to popups, which I implemented as described in the Help for HHW. They work fine in the context of the help system, but if I open the html file in a browser (Firefox or IE), they don't work - nothing happens at all when I click on the hot spots.
How do i block popups on a tabbed webbrowser? I know how to do it on one thats not tabbed though. This is what i got so far but it shows an error that says exactly "Value of type 'System.Windows.Forms.Control' cannot be converted to 'System.Windows.Forms.WebBrowserDocumentCompletedEventArgs.'"[code]
I'm using the WebBrowser control to automate some things in the background of my application but I'm getting this popup. How can I disable these popups in the webbrowser?
i want to do the following : select text in a web browser control, then click a button. When the button is clicked , the selected text should be copied to a richtextbox.
the main problem is how to copy the selected text from web browser control?
Im using VB2005 express and the app im creating uses the web browser control.Basically I want to know if its possible to make the web browser control connect through a different ip address and port from your default web browser.
I've looked throu all of the SendMessage(messages) but there does not seem to be anything like WM_GetPos.Now I can accomplish through AHK with ControlGetPos, but for the life of me I can not figure out what Win API function they are calling to accomplish this.We have an order entry system we use, that I am trying to automate the printing of our reports (we have 4 per order form) to save time
I am trying to use the Web Browser control in my vb .net user control. I am using VS 2008. Finally, I will be calling my assembly (.dll) from a web page. I wanted to display the usercontrol with the web browser control inside this web page. The problem is I cannot proceed since the Web browser control cannot be called from a partially trusted assembly. Using VS 2008 I have created a strong name for my class, also added the <Assembly: AllowPartiallyTrustedCallers()> to the AssemblyInfo. But still the web browser control cannot be seen in my web page. Do you how I can make my assembly fully trusted so that it can access web browser control? If you have used web browser control, can you confirm if this step is really required?!
I need the intPtr for a form. Control.FromHandle(control) gives me the control from a handle, but I need the opposite--get the handle from a control. How do I do this?
I would like for my program to navigate via textbox1.text with multiple lines and multiple url links inside of it. I know how to make the webbrowser1.navigate via textbox1.text with multiple lines, however I want my webbrowser to navigate to each url every 1-1.5 seconds once button1 is clicked. Yes, my webbrowser1 will navigate to the specified urls via the textbox1.text (multilines) with a button click, but I need the webbrowser1 to navigate in a order sequence from top to bottom of Textbox1.text (multiplelines) every 1 second. Here is the current code that I have to navigate via multilined textbox1.text control in order sequence:
I have a problem with a control leaking GDI handles.
This is the cut-down version of the control:
Public Class FancyLabel Inherits Label
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
[CODE]...
When I run the program, the GDI object count is 38. Then I open a form that has only one FancyLabel on it and the GDI object count gets increased to 42. I then close the form and the GDI count falls down to 39 and stays there no matter how many instances of the form I create and close.JV
I have a problem to handle an event on a custom control a have on a form.... So first i made a custom control that is just a groupbox with some labels and txtboxes. That control i add dynamically to my form like this (Baycontrol is the name of my control)
Declaration
Code: Friend Bay(29) As BayControl Add the controls to Form Code: For Simindex = 0 To 29 'Me.Bays - 1
I'm inheriting a couple of the common WinForms controls and then manually repainting them so that they will correctly render over a WinForm with the Aero Glass effect enabled. I have this working well with the TextBox. I ran into a snag with the ComboBox though in that it would only repaint some of the control. I fired up MS Spy++ and saw that the ComboBox has an Edit control in it (that's not in it's control collection). I can repaint that Edit box, but I need to get the handle of it and a couple of my attempts have flopped. I found some code that used the FindWindowEx API passing the Comboboxes handle but for me it returns 0.
Basically, I need the handle of the edit control inside the combobox (once I understand how to correct get that then I can get the additional controls in other ones I want like the ListView). Here's the Spy++ screen shots to illustrate (from Spy++ I can see the individual handles).
I use VB.NET 2010 I have created a user control which holds a few textboxes, where the user can find articles. This user control is added to several Forms (where ever the search is needed). I have to handle the key down event of the user control, but it isn't working... The usercontrols's Key_Down Event is never fired. - I have set KeyPreview of the form to true, then the Key_Down of the Form is fired.
My application uses an MDI form, and there are instances where the end user will need multiple child windows open at a time. I need an easy way for the user to switch between windows, which made me think of using tabs kinda like Firefox, or like the tabs in the Visual Studio IDE up at the top where you can switch between open forms and code files.
I'm curious if there is a control in .NET that will already do this? I would rather not re-invent the wheel if I can help it. Google has failed me thus far.
I show a waiting form (saying "Please wait...") on a different thread when there is long-running code in some forms (for example, during data loading). I show the form like this:
m_PopProcessingThread = New Thread(New ThreadStart( Sub() m_PopProcessingForm = New WaitingForm(m_Message) Application.Run(m_PopProcessingForm) End Sub))
[Code]...
The stack trace points to the part of code where I hide the form. How could the handle not have been created, when just before the Invoke call, I loop until said handle is created?
It seems the only options available to do multi-color on a string is either a bunch of label controls cleverly grouped together or to use a RichTextBox and play with the font properties as text is added to the control.
What I am looking for instead is some kind of control that can render some style of control codes out as color. Consider bash codes:
NORMAL='e[0m' GREEN='e[0;32m' BLUE='e[0;34m' echo -e "This text is ${GREEN}green${NORMAL} and this text is ${BLUE}blue${NORMAL}"
In the above, the words 'green' and 'blue' will be colorized with their respective colors. I was wondering if there was a control with some kind of feature like this, or will I have to code something myself?
Note, I only have the Express copy of VB 2010, and I would very much like to avoid third-party controls.
I have a problem whereby some rubbish code is not releasing its memory (eventually reaches the 10k handle limit and crashes).I'm looking to insert some logging in the application to dump a list of handles present at the point of failure.
if I wanted the button onclick event in a different class how would I declare it?
when I refer back to the form it says I need to declare with events..
Private Sub btnAddToLaneFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dispatch.btnAddToLaneFilter.Click If Me.txtCriteria.Text = "" Then
I'm trying to implement my own downloader. I have the download Form and I had a way to show it but, It's inefficent because, It just checked for ending extensions!I just want to cancel the download and show my downloader with the URL.[code]...
I have done this the other way many times as it makes sense (the page knows about the control as it has been added to the page and can handle the 'child' event)
Is it possible to do it the other way? I think not as the control doesn't know what page it is going to be on
The reason i ask this is that I have a modal popup on the page to ask users to login, and it is only when the user has logged in that I want my user control to go away and execute some code but I am not too sure how to tell the control this has happend?
I have the user control that is loaded dynamically. When the user save the data by clicking on the Save button, a raise event is passed.
Public Sub RaiseCloseEvent(ByVal sender As Object, ByVal e As System.EventArgs) RaiseEvent Close(sender, e) Debug.Print(String.Format("The control {{0}} was closed by {{1}}.", Me.Name, sender.ToString)) End Sub
In the save button I have called the RaiseCloseEvent as follows:
RaiseCloseEvent(sender, e)
Now, how can I close the user control form? Any Idea? I have used VB.Net language.
I am in need of adding arr of type label at run-time. I am making a program which will retrieve employee name from database in different label. On clicking each employee name (label) it will display all the information about that employee in a msgbox. I use the following code to create the label. Since the number of labels is not fixed I have used an array. dim withevents lblArr() as Label 'declared in the class
In the subroutine(Form load): for i as integer=0 to NoofEmployee-1 redim lblArr(NoofEmployee-1) lblArr(i)=new Label ' I assigned all the necessary property like size location etc.. me.controls.add(lblArr(i)) next
I declared another subroutine: private sub MyClick(sender as Object,e as EventArgs) **handles lblArr(0).click** MsgBox("Hello") end sub The code doesn't compile since a subroutine doesn't.
There is a panel which contains 2 components: a label and a TreeView. The hierarchy, obviously, looks like this:panel1 // handles Enter event
- label1 - treeView1
I need to do some UI updates when user starts interacting with any of these 3 controls. My attempted strategy was to catch the Enter event of the panel, which would fire when user clicks a label, or TreeView. This way, I can write only one (1) event handler instead of several. While it worked for the TreeView, it didn't work for the label. When I click the label, I don't get the Enter event on the panel. Whats different about the label control? I could handle the Click event of the label. At the same time, I wonder what the other solutions might be.