.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
VB.Net图解入门(图片较多,请稍等片刻)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

 

 

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是形成窗体的代码,不要直接修改,丛属性窗口设置他们

    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

 

 

buildexe 就行了,

只要对方装了Microsoft .NET Framework SDK,就不需要安装程序了,所有DLL等组件只要拷到当前目录即可,不存在注册的问题。Net的完全安装包大得惊人。好在支持大部分的系统(win9x,win2000

                                                            作者:hejianzhong         

                               VB.Net中文站 http://vbnetcn.126.com




相关文章

相关软件