Results 1 to 17 of 17

Thread: Opening Browser With Limitations...[RESOLVED!]

  1. #1

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Resolved 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.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Opening Browser With Limitations...

    Quote 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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  5. #5

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Re: Opening Browser With Limitations...

    Thanks y'all, I'll try that!
    CP

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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.

  7. #7

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    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

  8. #8

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Re: Opening Browser With Limitations...

    Quote 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

  9. #9
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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.

  10. #10

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Re: Opening Browser With Limitations...

    Cool, thanks. I'll check it out.
    CP

  11. #11

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    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

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  13. #13
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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...

  14. #14

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    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

  15. #15

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Re: Opening Browser With Limitations...

    I did Add/Remove, there's nothing in the list of available controls called WebBrowser at all.

    CP

  16. #16

    Thread Starter
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    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

  17. #17
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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
  •  



Click Here to Expand Forum to Full Width