没有合适的资源?快使用搜索试试~ 我知道了~
总结了VB.NET常用的几个技巧,非常实用,适合新手
资源推荐
资源详情
资源评论
本篇文章的主要开发环境是Visual Studio 2008,Visual Studio系列产品一直以来都提供了强大的控件功能,然而我们利用这些控件可以编写出功能强大的应用程序。本文主要利用微软的最新.net开发工具为大家展示窗体特效的应用方法,为大家介绍创建炫酷的透明化窗体以及浮动型窗体的一些技巧。很适合.net开发工具的初学者,具有一定的实用价值。
打开 Visual Studio 2008在文件 (File) 菜单上,单击新建项目 (New Project)。 在新建项目 (New Project) 对话框的模板 (Templates) 窗格中,单击 Windows 应用程序(Windows Application)。单击确定 (OK)
窗体应用技巧一,创建浮动窗体。
创建新工程后,选择Form1窗体,添加Timer1和Timer2控件。为窗体选择一个好看的背景,当然你也可以使用系统默认的背景。
进入代码编辑器,输入代码:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pos As Point = New Point(100, 50) '设置窗体初始位置
Me.DesktopLocation = pos
Timer1.Interval = 10 '设置Timer的值
Timer1.Enabled = True
Timer2.Interval = 10
Timer2.Enabled = False
End Sub
进入Timer1_Tick事件
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim pos As Point = New Point(Me.DesktopLocation.X + 2, Me.DesktopLocation.Y + 1) '窗体左上方横坐标的timer1加
If pos.X < 600 Or pos.Y < 400 Then
Me.DesktopLocation = pos
Else
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub
打开 Visual Studio 2008在文件 (File) 菜单上,单击新建项目 (New Project)。 在新建项目 (New Project) 对话框的模板 (Templates) 窗格中,单击 Windows 应用程序(Windows Application)。单击确定 (OK)
窗体应用技巧一,创建浮动窗体。
创建新工程后,选择Form1窗体,添加Timer1和Timer2控件。为窗体选择一个好看的背景,当然你也可以使用系统默认的背景。
进入代码编辑器,输入代码:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pos As Point = New Point(100, 50) '设置窗体初始位置
Me.DesktopLocation = pos
Timer1.Interval = 10 '设置Timer的值
Timer1.Enabled = True
Timer2.Interval = 10
Timer2.Enabled = False
End Sub
进入Timer1_Tick事件
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim pos As Point = New Point(Me.DesktopLocation.X + 2, Me.DesktopLocation.Y + 1) '窗体左上方横坐标的timer1加
If pos.X < 600 Or pos.Y < 400 Then
Me.DesktopLocation = pos
Else
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub
资源评论
jinshil2008
- 粉丝: 10
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功