CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: help

  1. #1
    Join Date
    Jun 2000
    Posts
    104

    help

    i want my user to type some code in a text box at the run time. and i want the code to execute on the click event of a command button.how can i do it?thanks a lot in advance for any reply.





  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: help

    Vb code will be a bit hard...If it is a Sql statement, you can do easily. What exactly are you looking for?

    Now, take this suggestment: do not post a question with title "Help", as it means nothing. Better to write a title related to the matter (ie, in this case:
    "exec code as string" or something similar).
    Best regards,
    Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: help

    have a look at this: it may help you.

    http://codeguru.earthweb.com/cgi-bin...age=&view=&sb=

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #4
    Join Date
    Apr 2001
    Posts
    23

    Re: help

    Put two textboxes and a command button on a form.
    The following runs the Windows Calculator when you
    type calc.exe in the first text box, don't include
    any quotation marks! After you close the calculator you will see the complete string in the
    second text box. I don't know if this is exactly what you are trying to do or not but you can get some ideas from it. Remember that all you have to
    do to activate a command button via code is to put
    "CommandButtonName_Click" or
    "CommandButtonName = True"
    anywhere in your project. Good Luck!


    option Explicit

    Dim a as string
    Dim b as string

    private Sub Command1_Click()

    a = Text1.Text
    b = "c:\windows\" + a

    Text2.Text = b

    Shell b

    End Sub







  5. #5
    johnpc7 Guest

    Re: help

    Put two textboxes and a command button on a form.
    The following runs the Windows Calculator when you
    type calc.exe in the first text box, don't include
    any quotation marks! After you close the calculator you will see the complete string in the
    second text box. I don't know if this is exactly what you are trying to do or not but you can get some ideas from it. Remember that all you have to
    do to activate a command button via code is to put
    "CommandButtonName_Click" or
    "CommandButtonName = True"
    anywhere in your project. Good Luck!


    option Explicit

    Dim a as string
    Dim b as string

    private Sub Command1_Click()

    a = Text1.Text
    b = "c:\windows\" + a

    Text2.Text = b

    Shell b

    End Sub







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

Featured