WebBrowser - Open New Window On Clicking ToolStrip Menu
Dec 26, 2009I am making a webbrowser and I want to make it that when I click on 'NewWindowToolStripMenuItem_Click' it opens a new window.
View 3 RepliesI am making a webbrowser and I want to make it that when I click on 'NewWindowToolStripMenuItem_Click' it opens a new window.
View 3 RepliesI'm trying to make it where when I click the subitem of a toolstrip menu, I can get the text I am clicking.
For example: This is my toolstripmenu, I'm trying to make it when I can get the text of what I'm clicking like the My Subscribers, My Contacts etc.
I tried this:
Private Sub ContextMenuStrip1_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ContextMenuStrip1.ItemClicked
End Sub
But all this does it get the main menu item click such as Add Selected Users to New Group. The subitems are added programmatically through this.
I have a treeview but now i want the nodes to open a new window.which means whenever i press a specific node i want a new window to appear.
View 2 RepliesHow to open a window in the program, by clicking a button open a window, like a settings window or so...
View 11 RepliesPrivate Sub LinkClicked(ByVal sender As Object, ByVal e As EventArgs)
Dim link As HtmlElement = WebBrowser1.Document.ActiveElement
Dim url As String = link.GetAttribute("href")
[code]...
Okay so here's the question how do I get the links that open in a new window to open in my main webbrowser control. The above code does some, but it's not fool proof.
This is probably a simple Q & A but I have a appication that is mainly compriesed of WebBrowsers. Would it be possible to have one of my WebBrowsers on a seperate window change the url of another webbrowser in a diffrent window?
Basiclly is there a way javascript or something else to change the target of a link on my website to target a open window's webbrowser in the application??
I am trying to trap the newwindow event for the webbrowser control using this code
Private Sub wbMain_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles wbMain.NewWindow
Dim wb As WebBrowser = DirectCast(sender, WebBrowser)
Dim link As HtmlElement = wb.Document.ActiveElement
[Code] .....
But the href property is always empty, this is because the active element is the last button clicked. But it is a button I click in the webbrowser control that opens a link in IE.
I am trying to get my Visual Basic Web Browser to open links and buttons when clicked in a new window of my web browser by using the New Window event. I found this code to make links work in a new window of my browser, but buttons will not. When I click on a button, a new window of my form pop ups but the url says, "about:blank". Is it because the attribute is set to "href"?
Private Sub WebBrowser1_NewWindow2(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
Dim myElement As HtmlElement = WebBrowser1.Document.ActiveElement
Dim target As String = myElement.GetAttribute("href")
Dim newInstance As New Form1
newInstance.Show()
newInstance.WebBrowser1.Navigate(target)
e.Cancel = True
I have searched the forums a bit in search of ways to find out how to prevent Internet Explorer to open when you click on a new window link in a WebBrowser control. I came across a topic with this code:
[Code]...
i m working on a payroll software, and for user facility i want to provide calculator and Microsoft excel file with our module, so there is no need to explciltly open the calculator,,whenever it is required,,,,,i want the code that provide me calculator by clicking a tool strip button on mdiform?
View 3 RepliesIs there another way to add a Context Menu to a ToolStrip other than using the MouseDown Event? I want to use it to let people select to either show text labels on buttons in the ToolStrip or turn them off.
View 6 RepliesIs it possible to add items to a toolstrip menu at runtime? Or to a menu strip?
View 6 RepliesI've been looking for a website that has images for menu/toolstrip objects like a folder image for Open, a clipboard for Paste, etc.Since I've had no luck at all, I've been assembling one myself.I've been using 16 x 16 images with cyan(R:0 G:255 B:255) as my transparent color.url...
View 3 RepliesMy program creates and populates a toolstrip menu at runtime dynamically. I would like my program to break the menu up into a new coloumn after say 40 menu items have been added to the toolstrip so the user doesnt have to do a long continous scroll to reach the bottom (Cascade). From my research i have found out that there is a feature called '.break' or '.breakbar' that allows for this kind of facility however this feature isnt available for toolstrip dropdown menus. Does anyone know of a workaround to allow a toolstrip to have this same functionality?.[code]
View 1 RepliesMy program creates and populates a toolstrip menu at runtime dynamically. I would like my program to break the menu up into a new coloumn after say 40 menu items have been added to the toolstrip so the user doesnt have to do a long continous scroll to reach the bottom (Cascade). From my research i have found out that there is a feature called '.break' or '.breakbar' that allows for this kind of facility however this feature isnt available for toolstrip dropdown menus.
Example of how menu should look:
Item1|Item6|Item11
Item2|Item7|Item12
[code]......
if you guys have used office 2003 or better( i am sure all) then you would have seen that when the help window open it causes the active windows say of MS WORD to change accordingly so that this help windows fits with it along the right side and this functionality i want to implement in my VB windows application and have no idea how to do it Also i have seen this feature in GOOGLE DESKTOP GADGETS...
i want to implement that when my application opens which ever is the active window( of any application) snaps to the left and allows my application to fir in the right hand side i am developing my application in VS 2005 using Visual Basic.
I've got a dynamically filled datagrid view. When a user right clicks a cell in the datagridview, it opens a context menu, located by that cell. The context menu has two choices: A and B. I want to set the value of the cell to A if they pick A, and B if they pick B.I would like to pass the relevant cell as a field in the event args passed to ContextMenu's ToolStripItem.click. So the handler for ToolStripItem A's click event would read the relevant cell from the event args and set it to A , like this...
Private Sub A_Click(ByVal sender As System.Object, ByVal e As Customized System.EventArgs) Handles A.Click
e.relevantCell.Value=A
End Sub
how to pass a custom event arg. Or if there is some easier way to do this? I can't just use the X and Y coordinates, because the context menu/mouse won't necessary by over the relevant cell.
Can I make my toolstrip backcolor match my window frames color automatically? Since frames are controlled by themes, can I set the toolstrip color in the IDE using the System tab and selecting one of the options, say Inactive Border color?
For example, if my theme uses a blue frame color, can I tell the toolstrip backcolor to match it somehow?
This is going to be hard to explain but oh well.I have a form with a menu. When I hit option one, it opens another form (form2) inside that same form (mdiparent). When I hit X on form2, then try to open it again from the original form with a menu thru the menu, It says it cant access a disposed object. Here is the code: Form1:
[Code]...
Working with a form that has a menu, toolstrip and Crystal Viewer control. I cannot seem to get the viewer to maximize properly without hiding the toolbar of the Crystal Control behind the menu and toolstrip. I've played with the options of Dock and Alignment, as well as autosize and I just can't get it to work.So do I need to handle the sizing myself to do this and position the control where I need it?
View 2 RepliesHow do you use the progressbar of the toolstrip to display the loading of the webbrowser?
View 3 RepliesI have a Main form, called Main.vb, that is a Parent Form. I have another form called Notes.vb. Inside Main.vb I have a toolstrip with a button on it called Notes. I'm wanting to change the checked status of the Button to either True when the Notes.vb window is open inside the parent or to false when it is close. Is this possible?
View 6 RepliesI would like a textbox to auto-size when the form is maximized and minamized. Like Internet Explorer when the address bar gets shorter and longer when you resize the window. I think the code so far is[code]...
View 3 RepliesI have a menu item that appears when right clicking over a datagridview. From their the user hovers over a menuitem and a list of other menu items appears, once again this repeats. Giving soemthing like this.
---------
| FOO |---------
---------| BAR |------------
---------| FOOBAR |
-----------
There is only to be an event (addressof) handled on the the 3rd tier. With that being said I need to grab the parent.name from FOOBAR and the parent.name of the said parent (grandparent).Here is where I am at:
If currentMouseRow >= 0 AndAlso currentMouseColumn <= 1 Then
dataGridView_monitorMapping.Rows(currentMouseRow).Selected = True
mainMenu.MenuItems.Add(New MenuItem("Set Monitor(s) Settings"))
[code]....
And the event handler
Public Sub updateMultiRowSettingChange(ByVal Sender As System.Object, ByVal e As System.EventArgs)
'TODO | Handle selection from right click menu.
End Sub
I am very much a beginner with VB. I want to create a simple menu or switchboard which will allow me to run one of several small exe files by clicking an appropriate button. The form and the buttons are OK, and I can get the exe files to run with code like:
Process.Start("C:Documents and Settings(myName)My DocumentsVisual Studio 2010ProjectsMathematicsProgram1.exe")
However I want the final application to be portable, i.e. not dependent on the long path name as above. My intention is that the final application and the exe files ie Program1.exe, Program2.exe, etc should all reside in the same directory so that the application can be run from a CD.
when i use the "anything.show" command, it will always open in a new window... How can i make it open in the same window?
View 11 RepliesIs it possible to be present a context menu when an item, any item, is right clicked in the ListView control? - If so, how?
View 5 RepliesHow does one get the context menu to appear when right clicking a "custom" windows title bar? I want the default context menu (the one that appears when clicking a forms caption bar) to show when clicking a control on a form... generally i want to make my own title bar (caption bar) for a form...the code that fails is "formTitleContext"also any suggestions to writing more concise code for this task will be greatly
View 4 RepliesI figured this would be simple, but I can't seem to figure it out. I can't make WebBrowser click the button I want without any errors involved.
[Code]...
I'm trying to make the program click on the "Join" button on that website, and with the code above it does click on the join button, but it seems to ignore any type of javascript involved with the button, therefore giving some type of website error. Is there a better way to click that button so it won't produce any website errors?
For the past couple weeks I've been tormented by this problem: I am trying to make a program that will go to a specific web site and add things to my cart on that page. I can get the program to go to the page, log into my account, and get to the right product. But, I can't figure out how to click on the ADD TO CART image.
Also, each product page has the main product, with an ADD TO CART image, and at other places on the screen there are other products shown, each with its own ADD TO CART image.I have been examining the source for the pages and here are a couple examples:
[Code]...
How can I click on one of those addToCart.gif images? It looks like they do not have names or IDs for me to refer to them with?