内容:
添加三个button控件,写代码如下:
Imports System.ComponentModel '引用 族名
System.ComponentModel
Imports System.Drawing '引用族名 System.Drawing
Imports System.WinForms '引用族名 System.WinForms
'引用族名的目的是在调用他的子类时不需要写出族名,如
system.drawing.color写成color
Public Class Form1
Inherits System.WinForms.Form ' Inherits是从已有的一个类
继承,得到这个类已定义的方法
Public Sub New()
MyBase.New() 'mybase是指代父类 mybase.new是调用父类的
new过程,new是新建一个对象,对象是存在内存的,类是并不存在内存
的
Form1 = Me '这样,下面的me关键字 就被认定为form1
InitializeComponent() '这下面的代码是在新建一个form1
的实例时执行的初始化动作
Call me_load() '这是自定义的一个子过程
End Sub
'Form overrides dispose to clean up the component list.
Overrides Public Sub Dispose()
AxMMControl1.Command = "close" '关闭声音资源,这个代
码一定要放在dispose过程的前面
MyBase.Dispose() 'dispose是清除对象
components.Dispose() '清空组件
End Sub
添加三个button控件,写代码如下:
Imports System.ComponentModel '引用 族名
System.ComponentModel
Imports System.Drawing '引用族名 System.Drawing
Imports System.WinForms '引用族名 System.WinForms
'引用族名的目的是在调用他的子类时不需要写出族名,如
system.drawing.color写成color
Public Class Form1
Inherits System.WinForms.Form ' Inherits是从已有的一个类
继承,得到这个类已定义的方法
Public Sub New()
MyBase.New() 'mybase是指代父类 mybase.new是调用父类的
new过程,new是新建一个对象,对象是存在内存的,类是并不存在内存
的
Form1 = Me '这样,下面的me关键字 就被认定为form1
InitializeComponent() '这下面的代码是在新建一个form1
的实例时执行的初始化动作
Call me_load() '这是自定义的一个子过程
End Sub
'Form overrides dispose to clean up the component list.
Overrides Public Sub Dispose()
AxMMControl1.Command = "close" '关闭声音资源,这个代
码一定要放在dispose过程的前面
MyBase.Dispose() 'dispose是清除对象
components.Dispose() '清空组件
End Sub
浙公网安备 33010602011771号