How to develop inspect element tab for my Web Browser(Using VS2015 Community) in VB.NET - vb.net

How to Develop inspect element tab section for my Web Browser which i've developed in VS2015 Community. Please help I'm searching this from last few days...

A suggestion for this could be using the TreeView Class which could potentially provide you with what you are looking for (If you're looking to create the 'Inspect Element' in it's entirety). If you just want the code then simply using the DocumentText WebBrowser Property would do that. Just having a TextBox and writing the document text into it, then you could make changes and then on a 'onFocus' Event on the WebBrowser you could have it write the edited text back to the browsers html code.
(I have done the second way before out of curiosity and it's obviously much simpler than the other way that i have suggested)
-
But with the TreeView :
You can dynamically add Nodes to that object.
Roots are 'Base' Nodes (Parents) and the and the Child, well, is obviously the Child of the Root Node.
(A node consisting of an actual name to call it by, a display name (text), and a tag for any extra info.)
But anyways, the TreeView would be the most work to do.
A few other things potentially worth your time to look at, if you chose to do either option, I've written below in a comment.

Related

How to make text within nodes findable in cytoscape.js, dagre-layout

I have been trying to use the dagre-layout in cytoscape.js to create a graph, however I seem unable to find the text within nodes, which I am able to do in dagre-d3, (EDIT: Find as in CTRL + F).
It seems like even in demos such as: http://js.cytoscape.org/demos/labels/ this is not available.
Any ideas on how to make it possible?
When working with Cytoscape, you're not working with traditional DOM elements for the nodes and edges. Rather it draws on a canvas. So are you screwed?
Nope. You just need to program a bit. Add a text box to your page. Add an on change listener to it (or add a button to search only when the user clicks it). When the user types, you can run a search that reads through all of the nodes in the graph. For speed you might want to implement a binary search based on the node's text.
When you find text that matches (exact or partial), you can add a class to change the visual appearance using Cytoscape.js' addClass method. You decision of how to show the data is up to you.

Tab Order in Visual Studio hates me

Tab Order in Visual Studio does not work for me for some reason.
I am making a VB.NET plugin for a cad program called Rhinocreos 5.
I have everything set perfect, and I don't know what the cause of it is.
I am using .Show() instead of .ShowDialog(), because I need that thread open and I don't feel like doing any thread management (not paid enough lol)
Does anyone have any pointers for this? Has anyone else ran into a tab problem with Rhino5 and .NET?
EDIT**
Seems I have to use a MODELESS Form for a rhino plugin.... So I wont have any tab keys or arrow keys unless I do a hook. But since I need to make the plugin future proof (in case I am no longer working here), I won't be doing that either. But thanks for the answers, comments, and awesome downvotes.
Very difficult to guess what's going on from the information you have provided, but I'd check the following things in the following order:
The disobedient form is open and has focus.
The form has controls in it.
At least some of the controls are enabled, focusable have their TabStop set to true.
There is no low-level keyboard handling in action (PreviewKeyDown, hooks etc).
Finally I'd call ShowDialog() instead of Show(), passing main form as parameter (to make disobedient form a child of main form) and see if that makes a difference.
It was a modeless form inside of Rhino3D as a plugin.
Rhino3D uses all plugins in the main thread. So tab is not an option.
The workaround was to tag all controls with a tag work (I used "tabMe")
Then I store all the controls in a List myTabbyControls.
Each time I press tab, I would cycle through the list.
But thanks for the down votes. It's the running joke of SO.

how to prevent dojo name text box remove/delete name onclick

I want prevent users from possibility to delete a name by accident from the list.. It should be possible to delete a name by clicking only on [x]...
Thanks
Reconsider the plan as Stephan says. My advice: you have used filter elements from OneUI framework. That's not a good choice in my opinion.
My suggestion is to use list element of OneUI instead, for example:
You might want to reconsider that plan :-) - the behavior of the dojo value picker in any other application is to make the full entry a click target - since you don't control other applications, you create an interaction inconsistency that will rather annoy users.
... But if you have to:
The Dojo UI interaction is deeply wired into that control and can't be changed easily. Your sensible option is to take the source of the control and create your own dojo/dijiit widget. Since dojo supports name spaces, that can coexist with the default control. Check the dojo documentation. It contains tutorials how to do that.
You might find there are better uses for your time.

How to control or edit text that is copied from a web page (for good, not evil reasons)

My web application allows members of the university to lookup and display their university ID number. It displays that number in an agreed upon format 99999-9999 which was picked to help distinguish it from, say, a Social Security Number, and to make it a bit more readable and easier to memorize. Unfortunately there are a few downstream applications that, for whatever reason, do not cope with the dash and expect a 9 digit integer. This becomes a problem when users, quite reasonably, use cut and paste to capture their ID number from my app and plug it into the afore mentioned brain dead app. I am unable to fix, nor can I apply pressure to have fixed, the brain dead apps, while I am being pressured to remove the hyphen. But before I do that, is there some straightforward, reliable technique that would somehow allow the user to see the ID number with the hyphen, but cause the number without the hyphen to be captured with a browser copy/cut operation?
Of course you can, now are you wanting to copy it from your web browser control or from an external internet explorer window? If external IE window, then you will need to get a reference to this window, which can be done using the windows title, then using that reference (or, if in a web browser control, directly using your web browser control), you can search for the element where that id resides in either by tag / element name, or tag / element id, or other means (ie: you will need to figure out if its in a div tag or span tag etc)... Once you find it, get a reference to it, probably using IHTMLElement to declare your reference type... And you'll be able to either copy it and do some string manipulation on it and store it wherever you want, or you can just update the live value on the page with the new value (live editing on the page the user is seeing, to change the elements value by copying id, removing hyphen from copy in a string variable, and then assigning it back to the element we got it from).
You can use the elements .value property to read from and assign to the element, depending on the element, but most elements use .value or innertext, once again, depending on the tag/element :).
Let me know if u need some code you will need to tell us what element we are dealing with, or the HTML sample of what surrounds the student Id you want to play with.

Supress pop-up with VB 2008 Express Edition

The radio recently broke in our bedroom and as a result my missus now listen to various radio stations through her laptop. She moans that visiting various pages and clicking the 'listen' link is a bit of a pain. (Note to self: Must buy new radio!)
In the meantime, I have made a 'radio player' in VB 2008 Express, which is nothing more than 6 buttons down the left hand side of the 'player' I have created and a Web Browser Control on the right hand side.
Clicking each button links to the relevant player of the station she wants to listen to. (Being a newbie to VB and programming, I'm quite proud with what I've achieved so far!!)
Anyway, one station I do link to gives an "Are you sure you want to navigate away from this page" prompt: This one:
http://www.mygoldmusic.co.uk/
Well, thats the homepage of the site anyway, the actual player is here:
(Oops, seems I can only post one link! The actual player opens on-click of the 'listen' button then, sorry to be a pain!)
My question is: Is there a way to suppress this message in VB, or even auto-answer OK somehow?
The other sites I have linked to do not display this message, they just navigate away quite happily. Clicking OK on the prompt is no real hardship either, I hear you say, but in the interests of usability, I would just like it to navigate away from the site/player without prompting.
Remember, I'm using Microsoft Visual Basic 2008 Express Edition. (I say that, because I've come across loads of sites that tell you how to do it with JavaScript, just not VB!)
I've got to the point of thinking it can't be done, but here's hoping!
Any help/advice would be greatly appreciated. And, sorry for the lengthy question. Hope it gives you enough info on what I'm trying to achieve.
Thanks in advance again.
J.
The only way I can think of is to actually modify the DOM of the page in the WebBrowser control. That popup is loading when the "window.onunload" event fires. You should be able to override this behaviour by modifying the DOM.
The HTML document DOM (Document Object Model, essentially an object graph of the page structure) is stored in the WebBrowser.HTMLDocument property. Unfortunately, that specific property isn't available to the .NET version. It IS available to COM however, so through some very ugly and messy code you might be able to suppress the event.
The following code should be able to access the COM property containing the HTML DOM. The type returned is IHTMLDocument2, although you'll note that the class itself will return an object. You might need to add a reference to mshtml.dll to get the IHTMLDocument2 interface access the properties of this in a reasonable way.
Dim domDocument As IHTMLDocument2 = webBrowser.HtmlDocument.DomDocument
You can then access the OnUnload event (which sits on the "window" element, one above the document). Unfortunately, the plot thickens a bit here (I did say it was going to be ugly) because you need to pass a IDispatch object to the onunload event. I've never done this specifically but I found a write-up at the following link that provides some samples and should point you in the right direction: http://blogs.msdn.com/cgarcia/archive/2009/08/28/handling-dom-events-in-a-c-activex.aspx
You should be able to follow a similar approach but simply do nothing in the handler method, which should suppress the javascript alert you are getting.
Get the handle to the dialog and destroy it. Use FindWindow and send a WM_CLOSE message to it.