四、程序语法说明
Imports System.ComponentModel
Imports System.Drawing
Imports System.WinForms
// Imports 的作用与with……….end with的意思是一样的 system.drawing.xxyy 在使用了Imports System.Drawing以后都可以写成xxyy。
Public Class Form1
// 在Class与End Class中间就是一个类了。
Inherits System.WinForms.Form
//Inherits表示这个类由System.WinForms.Form派生出来,具有所有父类已有的方法成员
Public Sub New()
//等于VB6K中的dim form as object 加 form=new xxxform,加 load form
MyBase.New
Form1 = Me
InitializeComponent //等于VB6中的Form_Load事件
Overrides Public Sub
//Dispose()等于VB6的form_unload事件 form1.dispose等于VB6的unload form1
MyBase.Dispose
components.Dispose
End Sub
#Region " Windows Form Designer generated code "
//Region是形成窗体的代码,不要直接修改,丛属性窗口设置他们
五、vb.net的工作面板视图

Private components As System.ComponentModel.Container
Private WithEvents Button1 As System.WinForms.Button
//这一句改成Public WithEvents Button1 As System.WinForms.Button以后你就可以在别的类中调用他,你应该在属性窗口修改他

Dim WithEvents Form1 As System.WinForms.Form
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.Button1 = New System.WinForms.Button()
Button1.Location = New System.Drawing.Point(200, 88)
Button1.Size = New System.Drawing.Size(56, 32)
Button1.TabIndex = 0
Button1.Text = "Button1"
Me.Text = "Form1"
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.Controls.Add(Button1)
End Sub
#End Region
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
End Class
保留:: http://www.qqread.com/vbdotnet/i820565000.html
更多内容请看Solaris基础知识入门、.NET移动与嵌入式技术、.NET开发手册专题,或进入讨论组讨论。
Imports System.ComponentModel
Imports System.Drawing
Imports System.WinForms
// Imports 的作用与with……….end with的意思是一样的 system.drawing.xxyy 在使用了Imports System.Drawing以后都可以写成xxyy。
Public Class Form1
// 在Class与End Class中间就是一个类了。
Inherits System.WinForms.Form
//Inherits表示这个类由System.WinForms.Form派生出来,具有所有父类已有的方法成员
Public Sub New()
//等于VB6K中的dim form as object 加 form=new xxxform,加 load form
MyBase.New
Form1 = Me
InitializeComponent //等于VB6中的Form_Load事件
Overrides Public Sub
//Dispose()等于VB6的form_unload事件 form1.dispose等于VB6的unload form1
MyBase.Dispose
components.Dispose
End Sub
#Region " Windows Form Designer generated code "
//Region是形成窗体的代码,不要直接修改,丛属性窗口设置他们
五、vb.net的工作面板视图

Private components As System.ComponentModel.Container
Private WithEvents Button1 As System.WinForms.Button
//这一句改成Public WithEvents Button1 As System.WinForms.Button以后你就可以在别的类中调用他,你应该在属性窗口修改他

Dim WithEvents Form1 As System.WinForms.Form
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.Button1 = New System.WinForms.Button()
Button1.Location = New System.Drawing.Point(200, 88)
Button1.Size = New System.Drawing.Size(56, 32)
Button1.TabIndex = 0
Button1.Text = "Button1"
Me.Text = "Form1"
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.Controls.Add(Button1)
End Sub
#End Region
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
End Class
保留:: http://www.qqread.com/vbdotnet/i820565000.html
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- Solaris基础知识入门 (4621篇文章)
- .NET移动与嵌入式技术 (5950篇文章)
- .NET开发手册 (5652篇文章)
- vb入门教程 (130篇文章)
- vb.net入门——ToolBar 控件的使用 (267次浏览)
- vb.net入门——OpenFileDialog 组件的使用 (75次浏览)
- vb.net入门——FontDialog 组件的使用 (52次浏览)
- vb.net用Graphics画一个五角星 (46次浏览)
- vb.net入门——FolderBrowserDialog 组件的使 (45次浏览)
- vb.net绘制干扰点 (44次浏览)
- vb.net入门——ColorDialog 组件的使用 (41次浏览)
- vb.net巧用ToolTip控件获取鼠标坐标 (39次浏览)
- 用vb.net创建一个鼠标绘图程序 (39次浏览)
- vb.net入门——SaveFileDialog 组件的使用 (38次浏览)



