Что-то я хода мысли не понял…i'm pissed писал(а):а не подскажешь как ?
желательно в файлик с настройками и чтобы он по завершению программы удалялся.
VBA.GetSetting
VBA.SaveSetting
Private Sub ReadBoxes(file as string)
dim tmp as byte
Open app.path & "\" & file for binary as #1
get #1, tmp
close #1
if tmp>0 then chkbox.checked=true
End Sub
Private Sub SaveBoxes(file as string)
Open app.path & "\" & file for binary as #1
if chkbox.checked=true then
put #1, 1
else
put #1, 0
end if
close #1
End Sub
Private Sub ReadBoxes(file as string)
On error resume next
dim tmp as byte
Open app.path & "\" & file for binary as #1
get #1, 1, tmp
if tmp>0 then checkbox1.checked=true
get #1, 2, tmp
if tmp>0 then checkbox2.checked=true
close #1
End Sub
Private Sub SaveBoxes(file as string)
On error resume next
Open app.path & "\" & file for binary as #1
if checkbox1.checked=true then
put #1, 1, 1
else
put #1, 1, 0
end if
if checkbox2.checked=true then
put #1, 2, 1
else
put #1, 2, 0
end if
close #1
End Sub
With Comb
.Clear
.AddItem "Кнопки"
.AddItem "Рисунок"
.ListIndex = 0
End With
Select Case Comb.ListIndex
Case 0 'Кнопки
If Check1.Value Then panel1.Show , frmBrowser Else panel1.Hide
If Check2.Value Then panel3.Show , frmBrowser Else panel3.Hide
Case 1 'Рисунок
If Check1.Value Then panel.Show , frmBrowser Else panel.Hide
If Check2.Value Then panel2.Show , frmBrowser Else panel2.Hide
End Select
Unload Me
Comb_Click
Private Sub ReadBoxes(file as string)
On error resume next
dim tmp as byte
Open app.path & "\" & file for binary as #1
get #1, 1, tmp
if tmp>0 then checkbox1.checked=true
get #1, 2, tmp
if tmp>0 then checkbox2.checked=true
close #1
Comb_Click
End Sub
Private Declare Function SetWindowPos Lib "User32" ( _
ByVal hWnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal x As Long, _
ByVal Y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Sub Form_Load()
ReadBoxes ("new.dat")
Call SetWindowPos(Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE)
With Comb
.Clear
.AddItem "Êíîïêè"
.AddItem "Ðèñóíîê"
.ListIndex = 0
End With
End Sub
Private Sub Command1_Click()
Select Case Comb.ListIndex
Case 0 'êíîïêè
If Check1.Value Then panel1.Show , frmBrowser Else panel1.Hide
If Check2.Value Then panel3.Show , frmBrowser Else panel3.Hide
Case 1 'ðèñóíîê
If CheckBox1.Value Then panel.Show , frmBrowser Else panel.Hide
If Check2.Value Then panel2.Show , frmBrowser Else panel2.Hide
End Select
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveBoxes ("new.dat")
End Sub
Private Sub ReadBoxes(file As String)
On Error Resume Next
Dim tmp As Byte
Open App.Path & "\" & file For Binary As #1
Get #1, 1, tmp
If tmp > 0 Then Check1.Checked = True
Get #1, 2, tmp
If tmp > 0 Then Check2.Checked = True
Close #1
Comb_click
End Sub
Private Sub SaveBoxes(file As String)
On Error Resume Next
Open App.Path & "\" & file For Binary As #1
If Check1.Checked = True Then
Put #1, 1, 1
Else
Put #1, 1, 0
End If
If Check2.Checked = True Then
Put #1, 2, 1
Else
Put #1, 2, 0
End If
Close #1
End Sub
Сейчас этот форум просматривают: PetalBot и гости: 8