Results 1 to 6 of 6

Thread: Label Click Open IE

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2003
    Posts
    42

    Label Click Open IE

    Hey guys, I got a quick question.


    I have a program that I wrote a while back and what it does is when
    a user clicks on a label it opens up a DOS Prompt and ping a IP and then
    exits out.


    What I would like to do is instead of pinging an IP at a DOS prompt.

    I would like for it to open up internet exploere with a specific IP or DNS name.


    So my user would click on this label and it automatically opens up IE with the IP address or URL that I have specified.


    Thanks in Advance
    ScarEye



    P.S. Noob to programming =)

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

    Re: Label Click Open IE

    In the labels click event you would shell or shellexecute the url that you want the browser to open up to.
    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

    Thread Starter
    Member
    Join Date
    Jun 2003
    Posts
    42

    Re: Label Click Open IE

    Quote Originally Posted by RobDog888
    In the labels click event you would shell or shellexecute the url that you want the browser to open up to.


    Where is the Click Event Option ?



    In my code section this is what I have

    If Index = 4 Then
    Shell "C:\Program Files\Internet Explorer\IEXPLORER http://www.google.com";



    That does not seem to work. Can you help me fix this ?


    Thanks in Advance
    ScarEye
    Last edited by ScarEye; Dec 22nd, 2005 at 07:13 PM.

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

    Re: Label Click Open IE

    As long as this is for your system its ok because the path and program may be different on someones elses computer.
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Label1_Click()
    4.     Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.vbforums.com", vbNormalFocus
    5. End Sub
    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
    Member
    Join Date
    Jun 2003
    Posts
    42

    Re: Label Click Open IE

    Okay this worked for me perfectly.

    Shell ("C:\Program Files\Internet Explorer\Iexplore.exe " & "www.google.com"), vbNormalFocus



    Now what do I have to do inorder to have it come up maximized ?


    Thanks for your help RobDog888

    ScarEye

  6. #6

    Thread Starter
    Member
    Join Date
    Jun 2003
    Posts
    42

    Re: Label Click Open IE

    Nevermind, I got it.. Thanks for you help.. =)



    ScarEye


    P.S. For the next poor soul that needs this info the answer is


    Shell ("C:\Program Files\Internet Explorer\Iexplore.exe " & "www.google.com"), vbMaximizedFocus

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