Results 1 to 6 of 6

Thread: Adding something in my program.

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    2

    Adding something in my program.

    Hi, I'd like to know how to add buttons, and when you press the buttons, text appears in a text box that I put in. Is that possible to create?


    Let me know,
    Jeremy

  2. #2
    Addicted Member
    Join Date
    Nov 2008
    Location
    UK
    Posts
    171

    Re: Adding something in my program.

    Quote Originally Posted by Feartheyankees View Post
    Hi, I'd like to know how to add buttons, and when you press the buttons, text appears in a text box that I put in. Is that possible to create?


    Let me know,
    Jeremy
    Hi,

    You don't know how to add buttons on a form? Well I suggest you play around in the IDE for a while or read some tutorials by searching google before asking questions here as you would be making a lot of posts.

    To add a button to the form just drag it from the toolbox or double click it, then it will appear on the form, very simple (you sure you mean that?).

  3. #3
    Lively Member Marthz's Avatar
    Join Date
    Nov 2009
    Posts
    115

    Re: Adding something in my program.

    This is very easy.

    To add a button just drag it to the form. Then to make it so the message box pops up.

    Double click it. Then add this.

    Code:
    MsgBox("Whatever you want the message to be", MsgBoxStyle.Information, "Title")

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    2

    Re: Adding something in my program.

    No, i know how to add a button. I just need to know how to add a code that'll do what I asked. Thanks

  5. #5
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Adding something in my program.

    I'd like to know how to add buttons, and when you press the buttons, text appears in a text box that I put in. Is that possible to create?
    It is not clear to me...
    But I think you want to display text inputted by the user, when he clicks a button, should be displayed in a text box.. Is it..???

    Then,
    Code:
    Private Sub Command1_Click()
    Text1.Text=InputBox("Please enter something","Text ?")
    End Sub

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  6. #6
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: Adding something in my program.

    Start a new exe project and add a button. Now double click it. This will bring you to the code window for the control in question and its default event, presently a command button. Now, go back to the form design view and change the command buttons name from command1 to commandTest. Set its caption and any other property you want. Double click on the button once again and you will see that it has once again taken you to the code window but the cursor is now in a different sub that has the controls new name.

    Now, if you look up above the code window or at the top (depends upon your point of view), you will see two combo boxes. The one on the left allows you to navigate between the different objects on the form and the form itself. Presently it should read commandTest (if you followed instructions above).

    Then, the combo box on the right will list the events that the object in question recieves (not all objects recieves the same events).



    Good Luck
    Option Explicit should not be an Option!

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