I even try this one but directcast always give me error...
Code:Private Sub SendMessageToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SendMessageToolStripMenuItem.Click Dim strMsg As String = InputBox("Enter your message to selected terminal", "Message") If strMsg = String.Empty Then Exit Sub Else For Each SelectedItems As ListViewItem In Me.lv_main.SelectedItems hostsComboBox.Items.Clear() hostsComboBox.Items.Add(SelectedItems.Tag & ":" & SelectedItems.SubItems(18).Text) If hostsComboBox.SelectedItem Is Nothing Then hostsComboBox.SelectedIndex = 0 End If Dim host = DirectCast(Me.hostsComboBox.SelectedItem, HostInfo) ' SEND MESSAGE TO ALL CLIENT SELECTED Me.server.Send(host, strMsg) Next End If End Sub




Reply With Quote