闁衡偓閹増顥� (0) +1 閻犙嶆嫹 (0) +1 闂婎亷鎷� (0) +1
闁衡偓閹増顥戦柟瀛樺姇婵拷闁哄被鍎冲﹢鍛村绩閹増顥�>>

正在阅读:VB.Net图解入门VB.Net图解入门

2004-02-14 09:34 出处:PConline 作者:hejianzhong 责任编辑:pjl
一、点击File -> Project,新建一个工程。: 二、在弹出的对话框中点击"Project Type"栏目下的第一项"Visual Basic Projects",然后在左边的"Templates"栏里选择"Windows Application"。记得输入工程名字并设置工程保存的目录 三、在弹出的对话框中点击"Yes" 四、程序语法说明 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 六、点击"Project Type"栏目下的第一项"Setup and Deployment Projects",然后在左边的"Templates"栏里选择"Setup Winzard ",输入安装程序的名字并设置输出路径,生成安装程序. 七、点击OK,build 成 exe 就行了。生成的exe文件存放在"Obj"目录。   只要对方装了Microsoft .NET Framework SDK,就不需要安装程序了,所有DLL等组件只要拷到当前目录即可,不存在注册的问题。Net的完全安装包大得惊人。幸好支持大部分的操作系统(win9x,win2000)

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
闁归潧顑嗗┃鈧悹浣告健濡拷闁搞儳鍋涢崺灞俱亜閸洖鍔�