Article ID: 138800
Article Last Modified on 1/8/2003
CreateGroup Reload (Windows 3.1 only) DeleteGroup ShowGroup ReplaceItem (Windows 3.1 only) DeleteItem (Windows version 3.1 only) AddItem
Control Property Value ---------------------------------------------------------------- Text box (Text1) Label (Label1) Caption Group Text box (Text2) Name GGroup Label (Label2) Caption Item Text box (Text3) Name GItem Label (Label3) Caption Command Line Text box (Text4 Name ItemExe Command button (Command1) Name CGroup (for create group) Command button (Command2) Name DGroup (for delete group) Command button (Command3) Name SGroup (for show group) Command button (Command4) Name Reload Command button (Command5) Name AItem (for add item) Command button (Command6) Name DItem (for delete item) Command button (Command7) Name RItem (for replace item)
Private Sub CGroup_Click ()
Dim cmd As String
On Error GoTo CGError
text1.LinkMode = 0
text1.LinkTopic = "Progman|Progman"
text1.LinkMode = 2
cmd = "[CreateGroup(" + GGroup.Text + ")]"
text1.LinkExecute cmd
CGDone: text1.LinkMode = 0
Exit Sub
CGError:
MsgBox "Error Adding Group"
Resume CGDone
End Sub
Private Sub DGroup_Click ()
Dim cmd As String
On Error GoTo DGError
text1.LinkMode = 0
text1.LinkTopic = "Progman|Progman"
text1.LinkMode = 2
cmd = "[DeleteGroup(" + GGroup.Text + ")]"
text1.LinkExecute cmd
DGDone: text1.LinkMode = 0
Exit Sub
DGError:
MsgBox "Error Deleting Group"
Resume DGDone
End Sub
Private Sub SGroup_Click ()
Dim cmd As String
On Error GoTo SGError
text1.LinkMode = 0
text1.LinkTopic = "Progman|Progman"
text1.LinkMode = 2
cmd = "[ShowGroup(" + GGroup.Text + ", 2" + ")]"
text1.LinkExecute cmd
cmd = "[ShowGroup(" + GGroup.Text + ", 1" + ")]"
text1.LinkExecute cmd
SGDone:
text1.LinkMode = 0
Exit Sub
SGError:
MsgBox "Error Showing Group"
Resume SGDone
End Sub
Private Sub Reload_Click ()
Dim cmd As String
On Error GoTo RLError
text1.LinkMode = 0
text1.LinkTopic = "Progman|Progman"
text1.LinkMode = 2
cmd = "[Reload(" + GGroup.Text + ")]"
text1.LinkExecute cmd
RLDone: text1.LinkMode = 0
Exit Sub
RLError:
MsgBox "Error Reloading Group"
Resume RLDone
End Sub
Private Sub AItem_Click ()
Dim cmd As String
On Error GoTo AIError
text1.LinkMode = 0
text1.LinkTopic = "Progman|Progman"
text1.LinkMode = 2
'*** The ShowGroup is necessary because AddItem changes the group
'*** with the focus. ShowGroup gives the focus to the group where
'*** you want the action taken.
If (Len(GGroup.Text) > 0) Then
cmd = "[ShowGroup(" + GGroup.Text + ", 2" + ")]"
text1.LinkExecute cmd
cmd = "[ShowGroup(" + GGroup.Text + ", 1" + ")]"
text1.LinkExecute cmd
End If
cmd = "[Additem(" + ItemExe.Text + "," + GItem.Text + ")]"
text1.LinkExecute cmd
AIDone:
text1.LinkMode = 0
Exit Sub
AIError:
MsgBox "Error adding Item"
Resume AIDone
End Sub
Private Sub DItem_Click ()
Dim cmd As String
On Error GoTo DIError
text1.LinkMode = 0
text1.LinkTopic = "Progman|Progman"
text1.LinkMode = 2
'*** ShowGroup is necessary because DeleteItem changes the group
'*** with the focus. ShowGroup gives the focus to the group where
'*** you want the action taken.
If (Len(GGroup.Text) > 0) Then
cmd = "[ShowGroup(" + GGroup.Text + ", 2" + ")]"
text1.LinkExecute cmd
cmd = "[ShowGroup(" + GGroup.Text + ", 1" + ")]"
text1.LinkExecute cmd
End If
cmd = "[DeleteItem(" + GItem.Text + ")]"
text1.LinkExecute cmd
DIDone: text1.LinkMode = 0
Exit Sub
DIError:
MsgBox "Error Deleting Item"
Resume DIDone
End Sub
Private Sub RItem_Click ()
Dim cmd As String
On Error GoTo RIError
text1.LinkMode = 0
text1.LinkTopic = "Progman|Progman"
text1.LinkMode = 2
'*** ShowGroup gives the focus to the group where you want the action
'*** taken.
If (Len(GGroup.Text) > 0) Then
cmd = "[ShowGroup(" + GGroup.Text + ", 2" + ")]"
text1.LinkExecute cmd
cmd = "[ShowGroup(" + GGroup.Text + ", 1" + ")]"
text1.LinkExecute cmd
End If
cmd = "[ReplaceItem(" + GItem.Text + ")]"
text1.LinkExecute cmd
cmd = "[Additem(" + ItemExe.Text + "," + GItem.Text + ")]"
text1.LinkExecute cmd
RIDone:
text1.LinkMode = 0
Exit Sub
RIError:
MsgBox "Error Replacing Item"
Resume RIDone
End Sub
Additional query words: 4.00 vb4win vb416
Keywords: KB138800