VB 4.0 32-bit Multi-Column List question! 
Author Message
 VB 4.0 32-bit Multi-Column List question!

We have an application written in VB 4.0 which run on both 16-bit and 32-bit.  
Therefore, all the control we use are 16-bit compatible.

In 16-bit we are able to show a multi-column list by setting TABS in the list
with an API call.  However, the same API call does not work in 32-bit and our
list is displayed without organized columns.

Does anyone know of a trick to display multi-column lists without using the
32-bit-only ListView control?


Thanks,

Iqbal M. Khan



Mon, 26 Oct 1998 03:00:00 GMT  
 VB 4.0 32-bit Multi-Column List question!


Quote:
>We have an application written in VB 4.0 which run on both 16-bit and 32-bit.  
>Therefore, all the control we use are 16-bit compatible.
>In 16-bit we are able to show a multi-column list by setting TABS in the list
>with an API call.  However, the same API call does not work in 32-bit and our
>list is displayed without organized columns.
>Does anyone know of a trick to display multi-column lists without using the
>32-bit-only ListView control?

>Thanks,
>Iqbal M. Khan

From VB4 Unleashed:

Declare Function SendMessage Lib "user32" Alias "SendMessageA"
((ByVal hWnd as Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Dim nTabPos(3) As INteger
Dim lResult As Long

'  Define the position
nTabPos(0) = 10
nTabPos(1) = 50
nTabPos(2) = 90

' Set the focus to the listbox and do it
List1.SetFocus
' Clear any exixting tab stops
lResult = SendMessage(GetFocus(), LB_SETTABSTOPS, 0, ByVal 0&)
' Set the tab stops from the array
lResult = SendMessage(GetFocus(), LB_SETTABSTOPS, 3, nTabPos(0))

I have not tried this yet, and it is NOT on the (crappy) CD that comes with the
book so I typed it in here by hand (watch out for my typing) but the book itself
seems pretty informed.

John



Mon, 26 Oct 1998 03:00:00 GMT  
 VB 4.0 32-bit Multi-Column List question!

Quote:


>>We have an application written in VB 4.0 which run on both 16-bit and 32-bit.  
>>Therefore, all the control we use are 16-bit compatible.
>>In 16-bit we are able to show a multi-column list by setting TABS in the list
>>with an API call.  However, the same API call does not work in 32-bit and our
>>list is displayed without organized columns.
>>Does anyone know of a trick to display multi-column lists without using the
>>32-bit-only ListView control?

>>Thanks,
>>Iqbal M. Khan

When I do this, after declaring GetFocus as:

Declare Function getfocus Lib "user" () As Integer

I get an error in loading the DLL, error 48, I believe.

Anyone have any thoughts as to why.

Thanks,
Todd

Quote:
>From VB4 Unleashed:
>Declare Function SendMessage Lib "user32" Alias "SendMessageA"
>((ByVal hWnd as Long, _
>ByVal wMsg As Long, _
>ByVal wParam As Long, _
>lParam As Any) As Long
>Dim nTabPos(3) As INteger
>Dim lResult As Long
>'  Define the position
>nTabPos(0) = 10
>nTabPos(1) = 50
>nTabPos(2) = 90
>' Set the focus to the listbox and do it
>List1.SetFocus
>' Clear any exixting tab stops
>lResult = SendMessage(GetFocus(), LB_SETTABSTOPS, 0, ByVal 0&)
>' Set the tab stops from the array
>lResult = SendMessage(GetFocus(), LB_SETTABSTOPS, 3, nTabPos(0))
>I have not tried this yet, and it is NOT on the (crappy) CD that comes with the
>book so I typed it in here by hand (watch out for my typing) but the book itself
>seems pretty informed.
>John



Tue, 27 Oct 1998 03:00:00 GMT  
 VB 4.0 32-bit Multi-Column List question!


Quote:
>We have an application written in VB 4.0 which run on both 16-bit and 32-bit.  
>Therefore, all the control we use are 16-bit compatible.
>In 16-bit we are able to show a multi-column list by setting TABS in the list
>with an API call.  However, the same API call does not work in 32-bit and our
>list is displayed without organized columns.
>Does anyone know of a trick to display multi-column lists without using the
>32-bit-only ListView control?

>Thanks,
>Iqbal M. Khan

The declare:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal
hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Long) As Long

The code to set tab-stops:
Dim lngRet As Long

ReDim arrTabs(0 To 2) As Long
arrTabs(0) = 45
arrTabs(1) = 250
arrTabs(2) = 300
lngRet = SendMessage(List1.hwnd, LB_SETTABSTOPS, 3, arrTabs(0))

This code sets 3 tabstops in a listbox called List1 at position 45,
250 and 300. It defenitely works. I use it myself in one of my
programs!

Hope it helps!
Ulf Erik Forsbakk

VB homepage (norwegian) http://www.forum.no/home/wolf/vb.htm



Fri, 30 Oct 1998 03:00:00 GMT  
 VB 4.0 32-bit Multi-Column List question!

If you are working in 32 bits windows you have to replace user with
user32.

Hope it helps!
Ulf Erik Forsbakk

VB homepage (norwegian) http://www.forum.no/home/wolf/vb.htm

Quote:
>When I do this, after declaring GetFocus as:
>Declare Function getfocus Lib "user" () As Integer
>I get an error in loading the DLL, error 48, I believe.
>Anyone have any thoughts as to why.

>Thanks,
>Todd




Fri, 30 Oct 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VB 4.0 32-bit Multi-Column List question!

2. TIME TO WIN 32-Bit DLL for VB 4.0 32-Bit or Higher (VB5)

3. TIME TO WIN 32-Bit (v4.04) (+750 functions) for VB 4.0 32-Bit

4. Calling a user-written 32-bit dll from 32-bit vb 4.0

5. Visual Basic 4.0 32-bit question on list boxes

6. VB 4.0 32-bit ListView bar across all columns

7. 16 bit API calls in VB 3 supported in 32 bit VB 4.0

8. Question on 32-bit GetModuleFileName api in VB 4.0 under Win95

9. VB 4.0 16 bit or 32 bit Escape Key

10. VB 4.0 (16-Bit)/Crystal Reports 3.0.1.32 (16-Bit) Print Preview Maximize Window

11. VB 4.0 conversion from 32 bit to 16 bit

12. VB 4.0: 16 bit vs 32 bit

 

 
Powered by phpBB® Forum Software