1 / 7

Windows Forms 编程 Winsock.dll WS2_32.dll

Windows Forms 编程 Winsock.dll WS2_32.dll. 0918. Forms (窗体)通常是指应用程序的顶级窗口,命名空间 System.WinForms 中的 Form 类代表了任何种类的应用程序窗体。可以建立标准、工具、无边框和浮动窗口。 Windows Forms 中包括了所有的标准 Windows 控件以及一些定制的 Windows 控件。 Form 类和所有组件的类都继承了 Control 类中的事件,在 System.Windows.Forms. Control 中共定义了大约 58 个事件。.

alima
Télécharger la présentation

Windows Forms 编程 Winsock.dll WS2_32.dll

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windows Forms编程Winsock.dllWS2_32.dll 0918

  2. Forms(窗体)通常是指应用程序的顶级窗口,命名空间System.WinForms中的Form类代表了任何种类的应用程序窗体。可以建立标准、工具、无边框和浮动窗口。Forms(窗体)通常是指应用程序的顶级窗口,命名空间System.WinForms中的Form类代表了任何种类的应用程序窗体。可以建立标准、工具、无边框和浮动窗口。 • Windows Forms中包括了所有的标准Windows控件以及一些定制的Windows控件。 • Form类和所有组件的类都继承了Control类中的事件,在System.Windows.Forms. Control中共定义了大约58个事件。

  3. 事件的命名规则:一个在状态改变之前发出,另一个在状态改变之后发出。之前的带有ing后缀,之后的带有ed后缀。事件的命名规则:一个在状态改变之前发出,另一个在状态改变之后发出。之前的带有ing后缀,之后的带有ed后缀。 • 在这样的事件处理方法中辨识不同的控件,可以检查事件处理方法的object参数。 button1.click+=new EventHandler(button1_Click); button2.click+=new EventHandler(button1_Click); private void button1_Click(object sender, EventArgs arg) { if (sender==button1) else if (sender==button2) }

  4. 菜单:主菜单和上下文菜单。 • 主菜单:创建窗体,建立MainMenu对象,创建MenuItem对象并定义菜单项的快捷键,可创建子菜单,定义菜单项命令处理程序。 • 使用ContextMenu类创建上下文菜单。当把ContextMenu赋给Form或控件时,设置的是ContextMenu属性。

  5. 一:无论是在窗体绘制内容,还是在自定义控件中绘制内容,都可以通过覆盖OnPaint方法实现。Graphics代表了GDI+的绘图,所有需要在窗口或控件中绘制的内容都是在这个对象上绘制的。一:无论是在窗体绘制内容,还是在自定义控件中绘制内容,都可以通过覆盖OnPaint方法实现。Graphics代表了GDI+的绘图,所有需要在窗口或控件中绘制的内容都是在这个对象上绘制的。 • 二:用户可以自定义重画窗口的方法,只需要把这个方法和窗口的Paint事件管理即可。

  6. 两个类用于注册表操作:Registry和RegistryKey,不能继承。两个类用于注册表操作:Registry和RegistryKey,不能继承。 • 可以利用PrintDocument和PrintPage来实现对文本文件的打印。

More Related