Results 1 to 8 of 8

Thread: Command buttons

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    158

    Command buttons

    i was wondering if it is possible to have a command button link to a URL which is typed in a text box.

    any help would be great
    thanx

  2. #2
    Addicted Member
    Join Date
    Jul 2004
    Location
    Mumbai
    Posts
    236

    Re: Command buttons

    hi welcome to the forums,

    are you asking something like this.,

    Code:
    <body>
    <script language="javascript">
    function ca(){
    // opens in the same window
    //	location.href = "http://www." + demo.t1.value + ".com"; 
    // opens in blank window
    	window.open( "http://www." + demo.t1.value + ".com", "Sample");
    }
    </script>
    <form name = "demo">
    <input type = "textbox" name = "t1">
    <input type = "button" name = "b1" value = "click" onclick="ca()">
    </form>
    </body>
    Last edited by kishore.kr; Jul 19th, 2005 at 12:32 AM.
    --Kishore...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    158

    Re: Command buttons

    oops sry....this is vb6.... so i need sumthing like

    Private Sub command1_Click()
    the code here
    End Sub

  4. #4
    Addicted Member
    Join Date
    Jul 2004
    Location
    Mumbai
    Posts
    236

    Re: Command buttons

    hi,
    then you have posted the question in wrong section of the forum. if you have posted in classic visual basic section, then you would have got your answer a long before.

    since i don't have exact idea how it can be done in vb, try posting it in the classic visual basic section.
    --Kishore...

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

    Re: Command buttons

    You can use the ShellExecute API.

    http://www.vbforums.com/showthread.php?t=350225

  6. #6
    Addicted Member
    Join Date
    Jul 2004
    Location
    Mumbai
    Posts
    236

    Re: Command buttons

    mendhak :
    that is a nice example. hope it solves the requirement.
    --Kishore...

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    158

    Re: Command buttons

    yes it works great...thank you...i am sry tho for being in the wrong section as i am new to this..once again thanx n sry

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

    Re: Command buttons

    Quote Originally Posted by kishore.kr
    mendhak :
    that is a nice example. hope it solves the requirement.
    It's one of the only APIs I could ever remember from my VB6 days. :reminisces:

    Of course, it's better in .NET now, you have System.Diagnostics.Process

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