|
-
May 10th, 2005, 10:56 AM
#1
Thread Starter
Lively Member
Opening Browser With Limitations...[RESOLVED!]
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
Last edited by milkmood; May 12th, 2005 at 01:32 PM.
-
May 10th, 2005, 08:58 PM
#2
Re: Opening Browser With Limitations...
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');
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 10th, 2005, 09:30 PM
#3
Re: Opening Browser With Limitations...
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.
-
May 10th, 2005, 09:44 PM
#4
Re: Opening Browser With Limitations...
 Originally Posted by mendhak
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
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 11th, 2005, 08:55 AM
#5
Thread Starter
Lively Member
Re: Opening Browser With Limitations...
Thanks y'all, I'll try that!
CP
-
May 11th, 2005, 10:12 AM
#6
Re: Opening Browser With Limitations...
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.
-
May 11th, 2005, 12:38 PM
#7
Thread Starter
Lively Member
Re: Opening Browser With Limitations...
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
-
May 11th, 2005, 12:47 PM
#8
Thread Starter
Lively Member
Re: Opening Browser With Limitations...
 Originally Posted by mendhak
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 did that and got it to work okay, but it's kind of messy.
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 ) 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
-
May 11th, 2005, 01:53 PM
#9
Re: Opening Browser With Limitations...
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.
-
May 11th, 2005, 01:55 PM
#10
Thread Starter
Lively Member
Re: Opening Browser With Limitations...
Cool, thanks. I'll check it out.
CP
-
May 12th, 2005, 10:52 AM
#11
Thread Starter
Lively Member
Re: Opening Browser With Limitations...
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
-
May 12th, 2005, 11:29 AM
#12
Re: Opening Browser With Limitations...
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 12th, 2005, 11:41 AM
#13
Re: Opening Browser With Limitations...
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...
-
May 12th, 2005, 11:42 AM
#14
Thread Starter
Lively Member
Re: Opening Browser With Limitations...
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
-
May 12th, 2005, 11:43 AM
#15
Thread Starter
Lively Member
Re: Opening Browser With Limitations...
I did Add/Remove, there's nothing in the list of available controls called WebBrowser at all.
CP
-
May 12th, 2005, 11:47 AM
#16
Thread Starter
Lively Member
Re: Opening Browser With Limitations...
Found it... I just noticed there's COM tab in the Add/Remove Controls dialog...it's called Microsoft Web Browser
Thanks,
CP
-
May 12th, 2005, 01:28 PM
#17
Re: Opening Browser With Limitations...
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|