473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

SendMerssage in vb.net

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
Mar 13 '07 #1
3 1089

"Nach" <Na**@discussions.microsoft.comwrote in message
news:A7**********************************@microsof t.com...
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

Mar 13 '07 #2
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

"Lloyd Sheen" wrote:
>
"Nach" <Na**@discussions.microsoft.comwrote in message
news:A7**********************************@microsof t.com...
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
Mar 13 '07 #3

"Nach" <Na**@discussions.microsoft.comwrote in message
news:FE**********************************@microsof t.com...
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

"Lloyd Sheen" wrote:
>>
"Nach" <Na**@discussions.microsoft.comwrote in message
news:A7**********************************@microso ft.com...
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
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

Mar 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.