Combobox and click event in Visual Basic 6.0

Using VisualBasic I am creating a small application program. In this app contains a Text box, a combo-box and a list box. The app accept a number, through text-box, as a limit and by choosing an item (Factorial,Fibonacci,Prime) from the combo-box generate a list in the list box. For example if you feed 5 then choosing factorial from combo box will generate a series in the list box.
Normally you do insert code into the combo-box control by double clicking on it . It will by default shows an event-procedure like Sub Combo1_Change(). This means that by default combo-box generate an change event. But this change event is not going to show the result in list box. To show the result of selected item into the list box just change the event _Change to _Click which usually do by selecting the combo on the top of the code window

Sub Combo1_Change()
'code goes here
end sub
to
Sub Comb1_Click()
'code goes here
End sub.

Example:

This application has text box, combobox and a list box. Combo box contain three options Facorial Fibonacci and Prime. In the text box user can enter the limit up to which the user want to find, the choice from the combo box.





 Design



Click to Download the code

No comments: