- Код: Выделить всё
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" _
(ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Function WriteINI(sSection As String, sKeyName As String, sNewString As String, sINIFileName As String) As Boolean
On Local Error Resume Next
Call WritePrivateProfileString(sSection, sKeyName, sNewString, sINIFileName)
WriteINI = (Err.Number = 0)
End Function
Function ReadINI(sSection As String, sKeyName As String, sINIFileName As String) As String
On Local Error Resume Next
Dim sRet As String
sRet = String(255, Chr(0))
ReadINI = Left(sRet, GetPrivateProfileString(sSection, ByVal sKeyName, "", sRet, Len(sRet), sINIFileName))
End Function
Private Sub Command1_Click()
Dim StringVar As String
WriteINI "time refresh", "frmBrowser.Timer1.Interval", CLng(timerefresh1.Text1.Text) * 1000, App.Path & "data.ini"
Hide
End Sub
Private Sub Form_Load()
Dim StringVar As String
StringVar = ReadINI("time refresh", "frmBrowser.Timer1.Interval", App.Path & "data.ini")
frmBrowser.Timer1.Interval = CLng(StringVar)
End Sub
а тут выделяет текст
- Код: Выделить всё
frmBrowser.Timer1.Interval = CLng(StringVar)