Hey All,
I'd like to open an html file (PickTicket.htm) on a button click, but want the browser to have only the File menu...no navigation, no links, no search bars, etc. Can this be done from the VB.NET code?
Thanks,
CP
Printable View
Hey All,
I'd like to open an html file (PickTicket.htm) on a button click, but want the browser to have only the File menu...no navigation, no links, no search bars, etc. Can this be done from the VB.NET code?
Thanks,
CP
In HTML/JavaScript you can designate the target window with "target=new" inline with the href property. Check out the JavaScript Forum for the exact syntax. ;)
Code:'JavaScript:
window.open('','NewWin','toolbar=no,status=no,width=100px,height=100px,resizable=no,scrollbars=no,top=100px,left=200px');
That'd work from a web page, not a winform.
What you could do is to do a process.start on an existing web page (that you created) on the local computer, passing the URL in the querystring. Parse the querystring and launch the window using window.open() with javascript.
I was just referring to the concept, which you explained to a T :DQuote:
Originally Posted by mendhak
Thanks y'all, I'll try that!
CP
you could always use the webbrowser control in your app as well since it sounds like its a local HTML file you are loading.. it would be pretty simpe to use the webbrowser control on a winform and then you can customize what options the user will have.
I'm not finding a webbrowser control; is it a custom control? . . . the closest one I can find is WebControl, but it's greyed out when I add it to the Toolbox
I'd like to explore this option further...you've given me sound advice in the past.
CP
I did that and got it to work okay, but it's kind of messy.Quote:
Originally Posted by mendhak
Depending on the user's browser settings, whether or not I can make the script close its own window and leave the desired window open, is a relative and seemingly unstable method.
Firefox won't close itself at all, and IE (w/ SP2 installed :sick: ) wants to first warn me that a script is trying to run, then warns me again that the script is trying to close the window. I have to assume that the users will have SP2 installed and using it's default settings.
There MUST be some seamless way of doing this without using two separate browser instances.
Thanks,
CP
milk
you need to go to references in your app, and click on the COM tab. Then scroll down and you will see Microsoft Internet Controls. Add that reference, and then you will be able to drop a webbrowser right onto your form like anyother control.
Cool, thanks. I'll check it out.
CP
Hey Matt,
Ok, I did what you said above, but what do you mean by "drop a webbrowser on my form"? Should there be something in the Toolbox now that wasn't there before?
CP
Yes, in your toolbox the web browser control should be under Window Forms or My User Controls tabs. Then you can
drag it on to your form.
its been so long since I have done it.. its always there now for me..
there may be a chance if its not there you need to right click on the toolbox and select add/remove items, and select it in there...
Well, it appears that it's not adding the Reference for some reason, I don't see it in the Solution Explorer, and the control isn't showing up in my Toolbox. I can find it in the COM list of available References...but...? What should the Reference be called in the Solution Explorer?
CP
I did Add/Remove, there's nothing in the list of available controls called WebBrowser at all.
CP
Found it... I just noticed there's COM tab in the Add/Remove Controls dialog...it's called Microsoft Web Browser
Thanks,
CP
glad to hear you got it... going forward it should remain in the toolbox, and if you add it to a future app from the toolbox, it should automatically add the needed references to your app