|
-
Nov 20th, 2000, 10:26 AM
#1
Thread Starter
Fanatic Member
OK if I have a combo box and then contents of that combo box are filled by a DB, and when the contents are filled and you click on the combo box at run time the combo box cuts off anything that is wider than itself. Is there a way without widening the combo box that I could have the combo boxes' white part (You know when you click on it the contenst have a white background) automatically adjst to the size of the widest line in the combo box?
-
Nov 20th, 2000, 10:46 AM
#2
You mean, set the dropdown width of the combobox?
Change the Public to Private if you want to use in the form declarations.
Code:
Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Long) As Long
Public Const CB_SETDROPPEDWIDTH = &H160
Public Sub SetComboWidth(oComboBox As ComboBox, _
lWidth As Long)
' lWidth is in pixels
SendMessage oComboBox.hwnd, CB_SETDROPPEDWIDTH, lWidth, 0
End Sub
-
Nov 20th, 2000, 10:52 AM
#3
_______
<?>
No, the textwindow of the combo box is part of the combo box and you cannot widen it without widening the combo box itself.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 20th, 2000, 11:15 AM
#4
Thread Starter
Fanatic Member
So would I then call the function?
-
Nov 20th, 2000, 11:25 AM
#5
Code Above
Code:
Usage
'Call SetComboWidth(Combobox, width)
Call SetComboWidth(Combo1, 500)
And it will make the white part bigger, but keep the combobox the same size.
This, therefore, proves HeSaidJoe wrong, who perhaps, tried to prove me wrong at first.
In conclusion, I am right! I am always right!
-
Nov 20th, 2000, 11:36 AM
#6
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|