60 likes | 220 Views
LIST BOX Control. . for producing a list of output items . and selecting an item for subsequent processing lstboxname.additem “bananas” - adds bananas to list lstboxname.removeitem 14 - removes 15th item from list lstboxname.clear - removes all items from list. COMBO BOX Control.
E N D
LIST BOX Control . for producing a list of output items . and selecting an item for subsequent processing lstboxname.additem “bananas” - adds bananas to list lstboxname.removeitem 14 - removes 15th item from list lstboxname.clear - removes all items from list
COMBO BOX Control . for entering data by typing in or . selecting from a pre-defined list
Place controls on form 1 x List Box, 1 x Combo Box 2 x Command Buttons , 2 x Text Boxes Private Sub Form_Load () For r = 0.05 to 0.15 step 0.01 cborate.additem ( r ) Next r cborate.listindex = 3 End Sub Sub cmdexit_click ( ) end End Sub
Cmdupdateschedule_click () [Pseudocode] 1. Obtain values for years, loan amount and rate from appropriate controls on the form. 2. Clear the list box. 3. Compute payment = pmt (rate, nper, pv) rate= monthly interest rate nper = no. of months pv = loan amount 4. Set opening balance = loan amount 5. For month = 1 to (years x 12) 5.1 Compute monthlyinterest = balance *rate/12 5.2 Compute monthlyprinciple = payment - monthlyinterest 5.3 Compute balance = balance - monthlyprinciple 5.4 Add month no, payment, and three computed amounts to box (lstpayments.additem period, payments, balance, principle, interest) 5. 5 Next month