PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Problem with ListView Selection First Time
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Problem with ListView Selection First Time
![]() |
Problem with ListView Selection First Time |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
When I create a very simple listview (as the only control in the
smartphone app) the down button the the pad doesn't move the cursor down until the second press. After that it works fine. When I add keypress and keydown events they all fire. I just don't understand why the selected item stays put until I press it twice. (again, just on the first time). Here is the simplest code I can think of that demonstrates this problem. private void Formtest_Load(object sender, EventArgs e) { ListViewItem lvi1 = new ListViewItem("listitem1"); ListViewItem lvi2 = new ListViewItem("listitem2"); ListViewItem lvi3 = new ListViewItem("listitem3"); listView1.Items.Add(lvi1); listView1.Items.Add(lvi2); listView1.Items.Add(lvi3); listView1.Items[0].Selected = true; } Thanks for any help on this -- Peter Kellner http://peterkellner.net |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Try a listView1.Focus()
Cheers Daniel -- http://www.danielmoth.com/Blog/ "Peter Kellner" <peter@peterkellner.net> wrote in message news:MPG.1d5804fd8830018b989694@news.sf.sbcglobal.net... > When I create a very simple listview (as the only control in the > smartphone app) the down button the the pad doesn't move the cursor down > until the second press. After that it works fine. When I add keypress > and keydown events they all fire. I just don't understand why the > selected item stays put until I press it twice. (again, just on the > first time). Here is the simplest code I can think of that demonstrates > this problem. > > private void Formtest_Load(object sender, EventArgs e) > { > ListViewItem lvi1 = new ListViewItem("listitem1"); > ListViewItem lvi2 = new ListViewItem("listitem2"); > ListViewItem lvi3 = new ListViewItem("listitem3"); > > listView1.Items.Add(lvi1); > listView1.Items.Add(lvi2); > listView1.Items.Add(lvi3); > > listView1.Items[0].Selected = true; > } > > Thanks for any help on this > > -- > Peter Kellner > http://peterkellner.net |
|
|
|
#3 |
|
Guest
Posts: n/a
|
This followup was posted to
microsoft.public.dotnet.framework.compactframework In article <e59nPaslFHA.708@TK2MSFTNGP09.phx.gbl>, dmoth74@hotmail.com says... > Try a listView1.Focus() > > Cheers > Daniel > -- Great hint. Almost worked. Made me think to try this: listView1.Items[0].Focused = true; which did work. Thanks -- Peter Kellner http://peterkellner.net |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

