markSaunders
Programmer
Problems with displaying the full text of the list contents in combo boxes? this little code enables you to define the width of the list section of a combo box (similar to the access type of combos) as a percentage. values of less than 100 are automatically forced to be 100(%).
this code was picked up along my travels (source not recorded)
if anyone manages to wrap up this functionality with the normal vbCombo control then please let me have a copy! i wrapped up a combo box with an added property of [tt].widthList[/tt] but ran into many problems trying to get other properties such as [tt].Style[/tt], [tt].List[/tt] and [tt].Index[/tt] to function as per the 'normal' vbCombo.
[tt]Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg _
As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub SetComboWidth(cboCombo As ComboBox, lngSetWidth _
As Long)
SendMessage cboCombo.hWnd, &H160, lngSetWidth, 0&
End Sub[/tt]
[sig]<p> Mark Saunders<br><a href=mailto: > </a><br><a href= Solutions</a><br> [/sig]
this code was picked up along my travels (source not recorded)
if anyone manages to wrap up this functionality with the normal vbCombo control then please let me have a copy! i wrapped up a combo box with an added property of [tt].widthList[/tt] but ran into many problems trying to get other properties such as [tt].Style[/tt], [tt].List[/tt] and [tt].Index[/tt] to function as per the 'normal' vbCombo.
[tt]Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg _
As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub SetComboWidth(cboCombo As ComboBox, lngSetWidth _
As Long)
SendMessage cboCombo.hWnd, &H160, lngSetWidth, 0&
End Sub[/tt]
[sig]<p> Mark Saunders<br><a href=mailto: > </a><br><a href= Solutions</a><br> [/sig]