TAILIEUCHUNG - Teach Yourself the C# Language in 21 Days phần 8

Nếu một ngoại lệ được ném ra, không có đảm bảo rằng xử lý sự kiện khác sẽ được thực bài học hôm nay, bạn đã học về một số trong những chủ đề phức tạp hơn trong C #. Trước tiên, bạn đã học được về indexers. Indexers có thể được sử dụng với một lớp học để bạn có thể truy cập vào các lớp học | 542 Day 16 This is exactly what you want. But wait If you run this program from directly within an operating system such as Microsoft Windows you will notice a slightly different result. The result will be a command-line box as well as the windows form See Figure . The command-line dialog box is not something you want created. Figure The actual display from the FirstFrm application. To stop this from displaying you need to tell the compiler that you want the program created to be targeted to a Windows system. This is done using the target flag with the winexe option. You can use t as an abbreviation. Recompiling the program in Listing with the following command results in the desired solution CSC r t winexe When you execute the program it does not first create a command window. You should be aware that some of the assemblies might be automatically included when you compile. For example development tools such as Microsoft Visual C .NET include a few assemblies by default. If an assembly is not included you get an error when you compile stating that an assembly might be missing. Analyzing Your First Windows Form Application Now that you can compile and execute a windows form application you should begin understanding the code. Look back at the code in Listing . Creating Windows Forms 543 In Line 4 the listing uses the namespace which enables the Form and Application class names to be shortened. In Line 6 this application is in a class named FirstFrm. The new class you are creating inherits from the Form class which provides all the basic functionality of a windows form. As you will learn in today s lesson the namespace also includes controls events properties and other code that will make your windows forms more usable. 16 With the single line of code Line 6 you have actually created the form s application class. In Line 10 you instantiate an object from this

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.