+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Tutorial - ListBox, ComboBox & Command button.

  1. #1
    travy92's Avatar
    travy92 is offline Learning Programmer
    Join Date
    Sep 2007
    Location
    Australia
    Posts
    76
    Rep Power
    17

    Post Tutorial - ListBox, ComboBox & Command button.

    INTRODUCTION
    Seeing as i've learned quiet a bit about visual basic, I'd like to introduce you to my second tutorial.
    (My first was "Tutorial - SmarterChild Copy")
    -------------------------------------------------------------------
    WHAT WE'RE DOING
    Basically in this mini tutorial we'll learn about adding text to a ListBox using a command button and a combo box/saving search history in combo box.
    -------------------------------------------------------------------
    GUI (Layout of the form)
    This is my GUI (Layout)

    You can use any GUI but this is mine.

    It consists of:
    1 Command Button:
    Name: "cmdPrint"
    Caption: "Add text to ListBox"

    1 ListBox:
    Name: "lstList"
    Caption: (None)

    1 ComboBox:
    Name: "cboText"
    Caption: (None)

    Note: Don't add the quotes in caption/name(").
    ----------------------------------------------------------------
    NAME EXPLANATIONS:
    cmdPrint: "cmd" stands for Command, since it's a command button, use cmd. "Print" means Print... Nothing special.. It can be anything you want.

    lstList: "lst" stands for List, since it's a ListBox, use lst. List simply means a list.

    cboText: "cbo" stands for ComboBox, since it's a ComboBox, use cbo. "Text" means text.
    ----------------------------------------------------------------
    CODE
    Private Sub cmdPrint_Click()
    lstList.AddItem cboText.Text
    cboText.AddItem cboText.Text
    End Sub
    This is all that's needed to make this very simply program.
    ----------------------------------------------------------------
    CODE EXPLANATION
    Private Sub cmdPrint_Click()
    Basically this means everytime you click cmdPrint, it will do the action as specified (Below)
    ----------------------------------------------------------------
    lstList.AddItem cboText.Text
    This code means add whatever text is written in the cboText.Text box to lstList box.
    ----------------------------------------------------------------
    cboText.AddItem cboText.Text
    This code means add the text that's written in cboText box into the cboText box... (So like saving history... This function can be used for an internet browser... I may be writing a tutorial on making an internet browser, if you want)
    ----------------------------------------------------------------
    End Sub
    This needs to be added at the end of every code.
    ---------------------------------------------------------------------------------
    And you're done!

    This is the example of the product with text in the ListBox.

    And another one with the text saved in the ComboBox (Or History if you will):

    ---------------------------------------------------------------------------------
    So this is goodbye for now.

    This tutorial was made by me, Travy92.

    Special thanks to Tcm9669 for the Screenshot program.

    EDIT - I'll include some samples for the lazy people..
    Attached Files Attached Files
    Last edited by Jordan; 09-10-2007 at 06:16 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    These are nice tutorials that you are making, and I noticed that you used a program from here to make screenshot so I modified it for you so whn you press Start or CTRL+S it will hide the window and when you press CTRL+E It will stop taking screens and the window will show again. Hope you like it, download it from here:

    http://forum.codecall.net/vb-tutoria...screen-v2.html

  4. #3
    travy92's Avatar
    travy92 is offline Learning Programmer
    Join Date
    Sep 2007
    Location
    Australia
    Posts
    76
    Rep Power
    17
    Oh man, i can't thank you enough! Wonderful !

  5. #4
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    No problem, hope you use it in your next tutorial. I fixed it btw, download it again.

  6. #5
    Lukica is offline Newbie
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0
    Thank you ... I was looking for this

  7. #6
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0
    Thanks for this! I think I'm going to find this very useful, and now, my post count is one I should be able to download it! lol :-)

  8. #7
    Bigig is offline Newbie
    Join Date
    Feb 2008
    Posts
    1
    Rep Power
    0
    Thanks for this, this will be very helpful.

    -BigIg

  9. #8
    jodlajodla is offline Newbie
    Join Date
    Mar 2008
    Posts
    1
    Rep Power
    0

    Re: Tutorial - ListBox, ComboBox & Command button.

    dan

  10. #9
    tigersubu is offline Newbie
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

    Re: Tutorial - ListBox, ComboBox & Command button.

    ....

  11. #10
    tigersubu is offline Newbie
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

    Re: Tutorial - ListBox, ComboBox & Command button.

    .


    COMBOBOX in HTML

    Try the code for COMBOBOX in HTML : Editable DropDown Listbox with any one select option as Editable (like a textbox ) and the rest as readonly.

    http://chakrabarty.com/pp_editable_dropdown.html

    http://chakrabarty.com/combobox.html

    .. it is a typeable combobox.



    .



    .

+ Reply to Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. Beginner Working with TextBox, ComboBox, ListBox and Button controls
    By Tonchi in forum CSharp Tutorials
    Replies: 0
    Last Post: 03-28-2011, 07:55 AM
  2. Replies: 1
    Last Post: 03-30-2010, 11:16 AM
  3. VB.net Button Auticlick Tutorial
    By iluxon4ik in forum Video Tutorials
    Replies: 0
    Last Post: 01-31-2010, 07:19 AM
  4. VB6.0:Tutorial, Command Line
    By TcM in forum Visual Basic Tutorials
    Replies: 11
    Last Post: 07-26-2009, 11:09 AM
  5. how to update another table at the same command button?
    By hanarina21 in forum Visual Basic Programming
    Replies: 4
    Last Post: 03-27-2007, 01:03 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts