Re: Finding flexgrid Items Using sendmessage



"Cmaz" <areejan2000@xxxxxxxxx> wrote in message
news:1128141729.104706.80980@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Rick
>
> thanks for responding.
>
> i use a listbox normaly for selection of names in my program .
> ie. on typing in a textbox the listbox will show the corresponding name
> in the list selected.
>
> but i need to show other details like telephone,area,Carno(code in
> arabic+english mixed )
>

One way would be to switch to a listview. It has built in 'Autoselect'
functionality just like Windows Explorer. For example.....

Start a new project, drop a listview on the form (it's in the Microsoft
Windows Common Controls 6.0 ocx), run this code. After the form shows, type
any of the first letters there (AA, AB, BA, BB) and the selection will jump
to that item. If they were longer words, you could continue typing and it
would jump to the closest match (just like windows explorer) This only works
for the first column.
'=============
Private Sub Form_Load()
With ListView1
.View = lvwReport
.LabelEdit = lvwManual
.ColumnHeaders.Add , , "Name"
.ColumnHeaders.Add , , "Address"

'Of course, you'd be doing this in some kind of loop but.....
With .ListItems.Add
.Text = "BB Name"
With .ListSubItems.Add
.Text = "BB Address"
End With
End With

With .ListItems.Add
.Text = "AA Name"
With .ListSubItems.Add
.Text = "AA Address"
End With
End With

With .ListItems.Add
.Text = "BA Name"
With .ListSubItems.Add
.Text = "BA Address"
End With
End With

With .ListItems.Add
.Text = "AB Name"
With .ListSubItems.Add
.Text = "AB Address"
End With
End With

End With
End Sub
'=============


--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..


.



Relevant Pages