Hey i have been working ON a mailing app for a company that is all SQL based i have most of it working but theres one thing that has me confused
it errors out if you right click and theres no name selected
vb Code:
Private Sub ListView2_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView2.MouseClick If e.Button = Windows.Forms.MouseButtons.Right Then Dim myListView As ListView 'Assign your ListView here. myListView = ListView2 For itemIndex As Integer = 0 To myListView.SelectedItems.Count - 1 For subitemIndex As Integer = 1 To myListView.Columns.Count - 1 If myListView.SelectedItems(itemIndex).Text = "" Then MsgBox(" You Need To Select A UserName") ContextMenuStrip3.Close() Else ContextMenuStrip3.Show() USERNAMEToolStripMenuItem.Text = myListView.SelectedItems(itemIndex).Text End If Next Next End If End Sub
i have tryed that code in the contect menu opening sub and also int he click sub but both dont work can anyone help me figure out ware i have gone Wrong





Reply With Quote