3个回答
展开全部
From的Load事件主要用于窗体加载时对一些变量或窗体上控件属性的初始化设置.例:
Private Sub Form_Load()
step1 = 1: Caption = "欢迎使用VB"
Timer1.Interval = 0
End Sub
又例:
Option Explicit
Dim fnt As Long
Public Function xp(colvb As Variant, xx As Variant, yy As Variant, fnt As Variant, txt As Variant)
Picture1.ForeColor = colvb
Picture1.CurrentX = xx
Picture1.CurrentY = yy
Picture1.FontSize = fnt
Picture1.Print txt
End Function
Private Sub Form_Load()
xx = 100: yy = 100
colvb = vbRed
txt = "123"
fnt = 24
wp = xp(colvb, xx, yy, fnt, txt)
yy = 200
xx = 2000
colvb = vbGreen
txt = "POY"
fnt = 48
wp = xp(colvb, xx, yy, fnt, txt)
End Sub
Private Sub Form_Load()
step1 = 1: Caption = "欢迎使用VB"
Timer1.Interval = 0
End Sub
又例:
Option Explicit
Dim fnt As Long
Public Function xp(colvb As Variant, xx As Variant, yy As Variant, fnt As Variant, txt As Variant)
Picture1.ForeColor = colvb
Picture1.CurrentX = xx
Picture1.CurrentY = yy
Picture1.FontSize = fnt
Picture1.Print txt
End Function
Private Sub Form_Load()
xx = 100: yy = 100
colvb = vbRed
txt = "123"
fnt = 24
wp = xp(colvb, xx, yy, fnt, txt)
yy = 200
xx = 2000
colvb = vbGreen
txt = "POY"
fnt = 48
wp = xp(colvb, xx, yy, fnt, txt)
End Sub
展开全部
一个窗体加载到内存的时候触发,也就是说一个程序运行时首先会执行一下load里的代码.
load里一般都放一些数据的初始化程序.
load里一般都放一些数据的初始化程序.
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
上面的同志已经写的很详细啦。不知道你看懂没有?打个比喻:就象刚一进别人家的门的时候,别人给你打声招呼!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询