Question: / / from external files 1 reference private void PopulateBoxes( ) try // Reads information form the text file StreamReader inputFile; inputFile = File. OpenText('Occasions.

 / / from external files 1 reference private void PopulateBoxes( )

/ / from external files 1 reference private void PopulateBoxes( ) try // Reads information form the text file StreamReader inputFile; inputFile = File. OpenText("'Occasions. txt") ; occasioncomboBox . Items . Clear ( ) ; while (!inputFile . EndofStream) occasioncomboBox. Items . Add (inputFile. ReadLine () ) ; / / close the file inputFile . Close( ) ; / / Select Birthday for the default item occasioncomboBox . SelectedItem - "Birthday"; inputFile = File . OpenText("'Extras. txt") ; extraslistBox. Items . Clear ( ) ; // Adds the contents of the file to the list box while ( !inputFile . EndofStream) extraslistBox. Items . Add (inputFile . ReadLine( ) ) ; catch (Exception ex) MessageBox. Show(ex. Message) ; this. Close( )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!