SendMerssage in vb.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What do I have to do to convert the following lines in .net
******************************
Dim result As Long
Dim SrchStr As String
SrchStr = txtPick
If Len(SrchStr) Then
result = SendMessage(lstpick.hwnd, LB_SELECTSTRING, -1, ByVal SrchStr)
*************************************
Does any one have any example in using SendMessage in .net
 
Nach said:
What do I have to do to convert the following lines in .net
******************************
Dim result As Long
Dim SrchStr As String
SrchStr = txtPick
If Len(SrchStr) Then
result = SendMessage(lstpick.hwnd, LB_SELECTSTRING, -1, ByVal SrchStr)
*************************************
Does any one have any example in using SendMessage in .net

Why don't you just use the Dot.Net classes. Looks like you are trying to
find an item in a listbox so just use the listbox control and its associated
API. Cleaner, easier and much better to be maintained.

Lloyd Sheen
 
Its exactly what I am trying to do, However I am new to .net
can you give me the exact associated API I have to use and if I have to
declare the API what is the syntax. Thanks
 
Nach said:
Its exactly what I am trying to do, However I am new to .net
can you give me the exact associated API I have to use and if I have to
declare the API what is the syntax. Thanks

Assuming that lstpick is a ListBox in a Windows Forms App you can add
objects to the listbox and then select them. If you are trying to select an
object (listitem) you would use the FindString or FindStringExact API.

If you are not familiar with Dot.Net I would suggest going to the MS site
and looking at some of the tutorials for VB.NET.

Lloyd Sheen
 
Back
Top