不会吧
比如为了保存按钮得标题
dim bln as boolean
private sub command1_click()
if bln then
command1.caption="x"
else
command1.caption="0"
end if
bln=not bln
propertychanged
end subprivate sub userdocument_writeproperties(propbag as propertybag)
propbag.writeproperty "command*"
end sub
private sub userdocument_readproperties(propbag as propertybag)
command1.caption=propbag.readproperty("command&")
end sub
比如为了保存按钮得标题
dim bln as boolean
private sub command1_click()
if bln then
command1.caption="x"
else
command1.caption="0"
end if
bln=not bln
propertychanged
end subprivate sub userdocument_writeproperties(propbag as propertybag)
propbag.writeproperty "command*"
end sub
private sub userdocument_readproperties(propbag as propertybag)
command1.caption=propbag.readproperty("command&")
end sub
解决方案 »
- VB使用P代码编译出来的居然比本地代码快N倍?
- 用WebBrowser控件打开了一个网页,已经屏蔽了鼠标右键,如何禁止用鼠标拖放上面的内容呢?
- 紧急求助:一对一文件传输问题
- 如何使vb中的toolbar中的某个按钮不可用?
- 如何在VB引用中加入IShellFolder^^^^
- 关于调用程序的 很难解决
- 解决了打印问题,散分!!!!!!
- vb隔段时间读取txt数据并显示
- 如何取得日期中的“天”,如:2002-2-24,我要取得"24"
- 怎样实现鼠标左键点击事件????48分..
- 关于ADODB.RECORDSET的问题 给出了ExecuteSQL函数 成功了就立即给分
- 如何制作自己的OCX控件?有相关的教程吗?
Private ser As String
Private user As String
Private pwd As String
Private db As String
Private cn As ADODB.ConnectionPublic Property Let Server(ByVal str As String)
ser = str
PropertyChanged "Server"
End PropertyPublic Property Get Server() As String
Server = ser
End PropertyPublic Property Let SerUid(ByVal str As String)
user = str
PropertyChanged "seruid"
End PropertyPublic Property Get SerUid() As String
SerUid = user
End PropertyPublic Property Let SerPwd(ByVal str As String)
pwd = str
PropertyChanged "serpwd"
End PropertyPublic Property Get SerPwd() As String
SerPwd = pwd
End PropertyPublic Property Let DataBase(ByVal str As String)
db = str
PropertyChanged "Database"
End PropertyPublic Property Get DataBase() As String
DataBase = db
End PropertyPrivate Sub Class_ReadProperties(PropBag As PropertyBag)
With PropBag
ser = .ReadProperty("Server")
user = .ReadProperty("SerUid")
pwd = .ReadProperty("SerPwd")
db = .ReadProperty("DataBase")
End With
End SubPrivate Sub Class_Terminate()
Set cn = Nothing
End SubPrivate Sub Class_WriteProperties(PropBag As PropertyBag)
With PropBag
.WriteProperty "Server", ser
.WriteProperty "SerUid", user
.WriteProperty "SerPwd", pwd
.WriteProperty "DataBase", db
End With
End SubPublic Property Get SerCon() As ADODB.Connection
Set cn = New ADODB.Connection
cn.Open "Provider=SQLOLEDB.1;Data Source=" & ser & ";Initial Catalog=" & db, user, pwd
Set SerCon = cn
End Property