All pastes #227317 Raw Edit

Mine

public text v1 · immutable
#227317 ·published 2006-10-29 05:02 UTC
rendered paste body
Private Sub cmdDel_Title_Click()
    ' If a user tries to remove a title without a title in the list, give error
    
    ' Works
    If lstCurr_Titles.ListCount = 0 Then  ' If there are no titles in the box, post error.
        MsgBox "There are no titles to remove right now, perhaps you mean to create one?", vbExclamation, "Removal Error"
        cmdAdd_Title.SetFocus
        Exit Sub                    ' We must exit this procedure since we are done!
    End If
    
    If lstCurr_Titles.SelCount = 0 Then
        MsgBox "You did not select a title to remove!", vbExclamation, "Removal Error"
        Exit Sub
    End If
    
    ' Remove selected title!
    lstCurr_Titles.RemoveItem lstCurr_Titles.ListIndex
    
    ' TODO: Make it so if there is a title in box but not selected, throw up a error.
    ' FIXED -^
End Sub