modPub.bas

前端之家收集整理的这篇文章主要介绍了modPub.bas前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Attribute VB_Name = "modPub"
Option Explicit

Public strAppPath$
Public intFontSize As Integer
Public strFontColor As String
Public lngFontColor As Long
Public strSplit As String

Sub Main() strAppPath = App.Path If Right(strAppPath,1) <> "/" Then strAppPath = strAppPath & "/" iniFileName = strAppPath & "user.INI" If Dir(iniFileName) <> "" Then Call initFromIniFile Else Call initFromApp Call saveToIniFile End If Form1.ShowEnd Sub'从配置文件初始化Private Sub initFromIniFile()' On Error GoTo err1 intFontSize = Trim(GetIniS("UserSet","FontSize")) strFontColor = Trim(GetIniS("UserSet","FontColor")) lngFontColor = Val(strFontColor) strSplit = Trim(GetIniS("UserSet","Split ")) Exit Suberr1: Call initFromApp Call saveToIniFileEnd Sub'保存到配置文件Public Sub saveToIniFile() SetIniS "UserSet","FontSize",CStr(intFontSize) SetIniS "UserSet","FontColor",CStr(strFontColor) SetIniS "UserSet","Split",CStr(strSplit)End Sub'用程序自身初始化Private Sub initFromApp() intFontSize = 10 strFontColor = "&HFFFF&" lngFontColor = Val(strFontColor) strSplit = "---------------------------------"End Sub

猜你在找的VB相关文章