Lost Password?


  #1 (permalink)  
Old 09-09-2007, 02:04 AM
travy92's Avatar   
travy92 travy92 is offline
Learning Programmer
 
Join Date: Sep 2007
Location: Australia
Age: 15
Posts: 72
Rep Power: 5
travy92 is on a distinguished road
Send a message via MSN to travy92
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
Quote:
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
Quote:
Private Sub cmdPrint_Click()
Basically this means everytime you click cmdPrint, it will do the action as specified (Below)
----------------------------------------------------------------
Quote:
lstList.AddItem cboText.Text
This code means add whatever text is written in the cboText.Text box to lstList box.
----------------------------------------------------------------
Quote:
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)
----------------------------------------------------------------
Quote:
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 To view attachments in this forum your post count must be 1 or greater. You currently have 0 posts.

Last edited by Jordan; 09-10-2007 at 09:16 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 09-09-2007, 06:25 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

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:

Code: Print Screen v2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-09-2007, 06:38 AM
travy92's Avatar   
travy92 travy92 is offline
Learning Programmer
 
Join Date: Sep 2007
Location: Australia
Age: 15
Posts: 72
Rep Power: 5
travy92 is on a distinguished road
Send a message via MSN to travy92
Default

Oh man, i can't thank you enough! Wonderful !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-09-2007, 07:20 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

No problem, hope you use it in your next tutorial. I fixed it btw, download it again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-08-2008, 10:55 AM
Lukica Lukica is offline
Newbie
 
Join Date: Jan 2008
Posts: 1
Rep Power: 0
Lukica is on a distinguished road
Default

Thank you ... I was looking for this
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 01-18-2008, 07:33 AM
sammy..the..great's Avatar   
sammy..the..great sammy..the..great is offline
Newbie
 
Join Date: Jan 2008
Posts: 1
Rep Power: 0
sammy..the..great is on a distinguished road
Send a message via MSN to sammy..the..great
Default

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 :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-02-2008, 01:24 AM
Bigig Bigig is offline
Newbie
 
Join Date: Feb 2008
Posts: 1
Rep Power: 0
Bigig is on a distinguished road
Default

Thanks for this, this will be very helpful.

-BigIg
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-11-2008, 12:54 PM
jodlajodla jodlajodla is offline
Newbie
 
Join Date: Mar 2008
Posts: 1
Rep Power: 0
jodlajodla is on a distinguished road
Default Re: Tutorial - ListBox, ComboBox & Command button.

dan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 07-06-2008, 12:48 AM
tigersubu tigersubu is offline
Newbie
 
Join Date: Jul 2008
Posts: 2
Rep Power: 0
tigersubu is on a distinguished road
Default Re: Tutorial - ListBox, ComboBox & Command button.

....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 07-06-2008, 12:48 AM
tigersubu tigersubu is offline
Newbie
 
Join Date: Jul 2008
Posts: 2
Rep Power: 0
tigersubu is on a distinguished road
Default 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.



.



.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB 6.0: Tutorial, Making a Port Scanner TcM VB Tutorials 93 Yesterday 08:14 AM
Tutorial: C# Hello World Jordan CSharp Tutorials 15 10-16-2008 11:44 PM
John's Java Tutorial Index John Java Tutorials 0 01-11-2007 04:05 PM
JSP Tutorial encoder JavaScript and CSS 0 05-26-2006 06:31 AM


All times are GMT -5. The time now is 10:57 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads