使用File控件.doc

使用File控件.doc

VB6常用方法汇编 一 基本语法和编程方法 使用静态变量 放置控件: Form1:Label1,Command1 属性设置: cLabel1.Autosize= true 代码: Private Sub Command1_Click() Static stflag As Boolean 使用静态变量来保存变量值 If stflag = False Then Label1.Font.Size = 14 stflag = True Else Label1.Font.Size = 9 stflag = False End If End Sub 创建对象 放置控件: Form1:Command1,text1 代码: Private Sub Command1_Click() Dim t1 As TextBox Set t1 = Form1.Text1 If t1.Text = 0 Then t1.BackColor = 0 t1.ForeColor = 255 End If End Sub 运行时,只要在Text1中写入0,点击Command1,Text1框就变色了。 如不用t1对象,则程序中t1.BackColor要写成form1.text1.BackColor,比较麻烦。 自定义方法和属性 放置

文档评论(0)

1亿VIP精品文档

相关文档