Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: How would I...


Message #1 by John Walborn <JWalborn@m...> on Wed, 31 Jan 2001 10:30:19 -0700
A combo is simply a text box and a list box, so you should be able to use
send message the same.  The challenge (though not overly difficult) is to
get the hwnd of the ListBox portion.



------------------------------------------
Christopher Tacke, MCSD
Rubicon Technologies
(xxx)xxx-xxxx


> -----Original Message-----
> From: Jeff Mason [mailto:jeffm@u...]
> Sent: Wednesday, January 31, 2001 4:49 PM
> To: professional vb
> Subject: [pro_vb] Re: How would I...
>
>
> You should have said so in the first place.  Turns out listboxes
> support tab
> stops in them via a SendMessage API call.
> Just perfect for formatting such things:
>
>    Public Const LB_SETTABSTOPS = &H192
>
>    Public Declare Function SendMessage Lib "user32.dll" _
>                     Alias "SendMessageA" (ByVal hWnd as long,
> ByVal wMsg as
> Long, _
> 				ByVal wParam as Long, lparam As Any) as long
>
>    Dim tabpos(0) As Long		'or as many tab stops as you want
>
>    tabpos(0) = 15
>    retval = SendMessage(TheListbox.hWnd, LB_SETTABSTOPS, 1, tabpos(0))
>
> Note that the tabpos array has the tabstop value(s) in dialog box units,
> roughly 1/4 of a character wide.  You may have to fool around
> with the value
> for your taste.  The 3rd argument of the SendMessage call is the number of
> tab stops; the fourth is *always* tabpos(0) as you are really passing the
> address of the array here.
>
> Anybody know how to do this for combo boxes??
> --
> Jeff Mason			Custom Apps, Inc.
>
> -----Original Message-----
> From: John Walborn [mailto:JWalborn@m...]
> Sent: Wednesday, January 31, 2001 4:05 PM
> To: professional vb
> Subject: [pro_vb] Re: How would I...
>
>
> I am actually populating a ListBox, but didn't want to get into all of the
> particulars of how to use a list box...  Just need to format the data in
> columns.
>

  Return to Index