Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim lstitemcolor As Variant
Dim selindex As Integer
Dim oldcolorb(31999) As Variant
Dim oldcolorf(31999) As Variant
Private Sub butchange_Click()
Call changeitem(Text1.Text)
End Sub
Private Sub butnew_Click()
Call additem(Text1.Text)
End Sub
Private Sub chklate_Click()
If chklate.Value = vbChecked Then
lstitemcolor = vbRed
Else
lstitemcolor = vbBlack
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyUp
If scr1.Value - scr1.SmallChange < 0 Then
scr1.Value = 0
Else
scr1.Value = scr1.Value - scr1.SmallChange
End If
Case vbKeyDown
If scr1.Value + scr1.SmallChange > scr1.Max Then
scr1.Value = scr1.Max
Else
scr1.Value = scr1.Value + scr1.SmallChange
End If
End Select
End Sub
Private Sub Form_Load()
scr1.Max = lst.Height - container.Height
scr1.LargeChange = scr1.Max \ 2
scr1.SmallChange = scr1.Max \ 5
b = 0
Do While b <= 31999
oldcolorf(b) = vbBlack
oldcolorb(b) = vbWhite
b = b + 1
Loop
End Sub
Private Sub lstitem_DblClick(Index As Integer)
butchange.Visible = True
chklate.Visible = True
Text1.Text = lstitem(Index).Caption
selindex = Index
End Sub
Private Sub lstitem_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
a = 0
num = lstitem.Count - 1
Do
If a = Index Then
With lstitem(a)
.BackColor = vbBlue
.ForeColor = vbWhite
End With
Else
With lstitem(a)
.BackColor = oldcolorb(a)
.ForeColor = oldcolorf(a)
End With
End If
a = a + 1
Loop Until a > num
End Sub
Private Sub scr1_Change()
lst.Top = -scr1.Value
End Sub
Public Sub additem(lsttext As String)
Dim addtoh As Integer
nextlistitem = lstitem.Count
Load lstitem(nextlistitem)
With lstitem(nextlistitem)
.BackColor = oldcolorb(nextlistitem)
.ForeColor = oldcolorf(nextlistitem)
.Top = 22 * nextlistitem
.Left = 0
.Width = 213
.Height = 22
.Caption = lsttext
.Visible = True
End With
testvar = nextlistitem * 390
If testvar > lst.Height Then
addtoh = (nextlistitem * 390) - lst.Height
lst.Height = lst.Height + addtoh
End If
scr1.Max = lst.Height - container.Height
scr1.LargeChange = scr1.Max \ 5
scr1.SmallChange = scr1.Max \ 10
End Sub
Public Sub changeitem(txt As String)
With lstitem(selindex)
.Caption = txt
.BackColor = vbWhite
.ForeColor = lstitemcolor
End With
oldcolorb(selindex) = lstitem(selindex).BackColor
oldcolorf(selindex) = lstitem(selindex).ForeColor
chklate.Visible = False
butchange.Visible = False
End Sub