Hi,

i have a listbox in my pda program (Visual Studio 2005) that contains all
COM-Ports.
I want to connect my program to the port if the user clicks at a item of
this listbox.

But here is my problem :
There is no Click-Event, i found SelectedItemCanged but this event is not
fired if the user clicks at the item that is always selected!
I want to reconnect to the COM port every time the user click at a item,
what can i do?

thanks
Stefan

Re: No Click event in Listbox ? by Sven

Sven
Tue Oct 24 10:33:27 CDT 2006

Hi Stefan

Ich bin's wieder :-P Dachte ich könnte auch gerade noch die Lösung geben...
Selectedindex anstelle von selecteditem

Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
MsgBox(ListBox1.SelectedItem)
End Sub

Gruss

Sven

"Stefan Koschke" <stefan.koschke@t-online.de> schrieb im Newsbeitrag
news:4q6ie4FlddneU1@individual.net...
> Hi,
>
> i have a listbox in my pda program (Visual Studio 2005) that contains all
> COM-Ports.
> I want to connect my program to the port if the user clicks at a item of
> this listbox.
>
> But here is my problem :
> There is no Click-Event, i found SelectedItemCanged but this event is not
> fired if the user clicks at the item that is always selected!
> I want to reconnect to the COM port every time the user click at a item,
> what can i do?
>
> thanks
> Stefan
>



Re: No Click event in Listbox ? by Stefan

Stefan
Wed Oct 25 01:10:40 CDT 2006

Hallo Sven,

ich habe Mist geschrieben, und meinte SelectedIndexChanged. Der wird aber
(wie der Name schon sagt) nur bei Klick auf einen anderen nicht ausgewählten
Eintrag ausgelöst und nicht wenn man den bereits ausgewählten nochmal
anklickt :-(

Ciao
Stefan

"Sven Rutten" <--> schrieb im Newsbeitrag
news:uotoLH49GHA.748@TK2MSFTNGP02.phx.gbl...
> Hi Stefan
>
> Ich bin's wieder :-P Dachte ich könnte auch gerade noch die Lösung
> geben...
> Selectedindex anstelle von selecteditem
>
> Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
> MsgBox(ListBox1.SelectedItem)
> End Sub
>
> Gruss
>
> Sven
>
> "Stefan Koschke" <stefan.koschke@t-online.de> schrieb im Newsbeitrag
> news:4q6ie4FlddneU1@individual.net...
>> Hi,
>>
>> i have a listbox in my pda program (Visual Studio 2005) that contains all
>> COM-Ports.
>> I want to connect my program to the port if the user clicks at a item of
>> this listbox.
>>
>> But here is my problem :
>> There is no Click-Event, i found SelectedItemCanged but this event is not
>> fired if the user clicks at the item that is always selected!
>> I want to reconnect to the COM port every time the user click at a item,
>> what can i do?
>>
>> thanks
>> Stefan
>>
>
>