Program Freezing VB.NET
Posted on 2005-03-16
I have a program that updates group membership.
It bascially updates a list of groups from a list box and loops until it finishes.
There is a status bar that display which groups it is updating.
The program interface freezes but it always finishes all the group updates.
I am looking for a way to make sure the program does not freeze and always shows what it is doing.
I have read about threading, would this solve the problem
an example of the code
For Each anItem In lstMembership.SelectedItems
If CheckGroup(anItem) = False Then
If UpdateGroupMem(FullName(sUserE, sTree), FullName(anItem, sTree)) = True Then
PrintLine(1, "Is Already a Member of " & anItem & " Group not Added")
statInfo.Text = "Is Already a Member of " & anItem & " Group not Added"
sLogError = sPath & "Log\" & sLogName & ".log"
sAlready = True
statInfo.Text = anItem
MsgBox("Unable to Update Group: " & anItem & " Group is not allowed", MsgBoxStyle.Critical)
Catch er As Exception
MsgBox(er.Message, MsgBoxStyle.Critical, "Add to Group")