Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Agenda: Introduction Windows Forms, How to handle events in Windows Forms, Adding controls to forms (design-time), Dynamically adding controls to Forms (runtime), Using Complex Controls, Creating GUI Components, Working with Menu, Creating MDI applications with Windows Forms, Deploying Windows Forms Applications. | Chapter 3 Programming with Windows Forms Department of Software Engineering Faculty of Information Technology Natural Sciences University Agenda Introduction Windows Forms How to handle events in Windows Forms Adding controls to forms (design-time) Dynamically adding controls to Forms (runtime) Using Complex Controls Creating GUI Components Working with Menu Creating MDI applications with Windows Forms Deploying Windows Forms Applications What is Windows Forms (a.k.a. WinForms)? Windows Forms is part of the .NET framework core classes in System.Windows.Forms namespace design-time support in various namespaces Windows Forms provides classes for building UIs e.g. custom forms, common controls, standard dialogs Visual Studio .NET provides tools for using Windows Forms templates for common starting places, and a visual designer Windows Forms Application Structure A Windows Forms application has three pieces the application itself forms in the application controls on the form Application | Chapter 3 Programming with Windows Forms Department of Software Engineering Faculty of Information Technology Natural Sciences University Agenda Introduction Windows Forms How to handle events in Windows Forms Adding controls to forms (design-time) Dynamically adding controls to Forms (runtime) Using Complex Controls Creating GUI Components Working with Menu Creating MDI applications with Windows Forms Deploying Windows Forms Applications What is Windows Forms (a.k.a. WinForms)? Windows Forms is part of the .NET framework core classes in System.Windows.Forms namespace design-time support in various namespaces Windows Forms provides classes for building UIs e.g. custom forms, common controls, standard dialogs Visual Studio .NET provides tools for using Windows Forms templates for common starting places, and a visual designer Windows Forms Application Structure A Windows Forms application has three pieces the application itself forms in the application controls on the form Application mainForm MyForm label1 button1 Label “Hell ” Button “OK” System.Windows.Forms.Application The Application class represents the application itself no instances (all properties and methods are static) processes UI events delivered by Windows Run, DoEvents provides access to application environment ExecutablePath, StartupPath CommonAppDataPath, UserAppDataPath CommonAppDataRegistry, UserAppDataRegistry class MyApp { public static void Main() { MyForm form = new MyForm(); System.Windows.Forms.Application.Run(form); } } Application Properties CommonAppDataPath Gets the path for the application data that is shared among all users. CommonAppDataRegistry Gets the registry key for the application data that is shared among all users. ExecutablePath Gets the path for the executable file that started the application, including the executable name. StartupPath Gets the path for the executable file that started the application, not including the executable name. UserAppDataPath Gets the path for the