Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатика
ИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханика
ОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторика
СоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансы
ХимияЧерчениеЭкологияЭкономикаЭлектроника

PART II. Coding

PART I. GUI

1. Create a Windows Form Project: Area Code Search

2. Populate the following controls on the form

a. a MenuStrip, top level menu items: File and About;
File’s second level menu items: Open and Exit.

b. a Button for begin the search process;

c. a small TextBox for entering an area code;

d. a large TextBox for displaying search results.

3. Name the above controls in Hungarian notation. Adjust other properties necessary for your designing purpose.


The following is how the designer window may look like. You may design a different type of GUI as long as user can understand it.

 

 

 


PART II. Coding

1. Declare a class-level List(Of String) for storing area code information.

2. Write procedures for menu item Open, Exit, About. The first one must make use of OpenFileDialog. The file to be opened is “area code.txt” (which may be copied from teacher’s folder). It also must use StreamReader to read the file line by line. It uses these lines to populate the List declared in step one. Finally the List is displayed in the large textbox.

3. Write a procedure for the button to start a search. It first declares a variable to store the search term entered in the small textbox. It then traverses the List, displaying all items that contain the search term in the large textbox. Finally it checks if anything has been displayed in the large textbox. If not, “[search term] is not found.” Will be displayed instead.

(When debugging, the project may look like the following image)


Дата добавления: 2015-07-20; просмотров: 90 | Нарушение авторских прав


<== предыдущая страница | следующая страница ==>
Общие теоремы динамики сплошной среды. Закиров И.Р.| Theme: 3D-Technology

mybiblioteka.su - 2015-2024 год. (0.005 сек.)