Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
X
Bonjour, je crois que c'est le système qui détermine la taille, voir sir les API (mais on sort de VB), peuvent modifier ça? Sinon, prendre une listBox...
-- Site logiciels http://irolog.free.fr Mail http://irolog.free.fr/ecrire/index.htm Site perso http://irolog.free.fr/joe/index.htm Principe d'utilisation des news Groups http://support.microsoft.com/directory/worldwide/fr/newsgroup/regles.htm ------------------------------------------------------------------------------------ "Daniel AUBRY" a écrit dans le message de news: 44ed90db$0$1730$
Bonjour à tous,
comme dit dans le titre, je cherche à paramétrer le nombre déléments visivles dans une liste déroulante. En fait je cherche surtout à l'agrandir.
Si quelqu'un a une piste.........
D'avance, merci.
Dany
Bonjour, je crois que c'est le système qui détermine la taille, voir
sir les API (mais on sort de VB), peuvent modifier ça? Sinon, prendre une
listBox...
--
Site logiciels
http://irolog.free.fr
Mail
http://irolog.free.fr/ecrire/index.htm
Site perso
http://irolog.free.fr/joe/index.htm
Principe d'utilisation des news Groups
http://support.microsoft.com/directory/worldwide/fr/newsgroup/regles.htm
------------------------------------------------------------------------------------
"Daniel AUBRY" <mail@daniel-aubry.com> a écrit dans le message de news:
44ed90db$0$1730$626a54ce@news.free.fr...
Bonjour à tous,
comme dit dans le titre, je cherche à paramétrer le
nombre déléments visivles dans une liste déroulante.
En fait je cherche surtout à l'agrandir.
Bonjour, je crois que c'est le système qui détermine la taille, voir sir les API (mais on sort de VB), peuvent modifier ça? Sinon, prendre une listBox...
-- Site logiciels http://irolog.free.fr Mail http://irolog.free.fr/ecrire/index.htm Site perso http://irolog.free.fr/joe/index.htm Principe d'utilisation des news Groups http://support.microsoft.com/directory/worldwide/fr/newsgroup/regles.htm ------------------------------------------------------------------------------------ "Daniel AUBRY" a écrit dans le message de news: 44ed90db$0$1730$
Bonjour à tous,
comme dit dans le titre, je cherche à paramétrer le nombre déléments visivles dans une liste déroulante. En fait je cherche surtout à l'agrandir.
Si quelqu'un a une piste.........
D'avance, merci.
Dany
Driss HANIB
Trouvé dans un prog français, reprenant lui même des données sur mvps.org
'The Visual Basic combo box dropdown - unlike its C counterpart - 'is limited to displaying only eight items. 'This page shows how to change the dropdown height to any number greater than eight.
Private Type POINTAPI X As Long Y As Long End Type
Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
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 Declare Function MoveWindow Lib "user32" _ (ByVal hwnd As Long, _ ByVal X As Long, ByVal Y As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long, _ ByVal bRepaint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" _ (ByVal hwnd As Long, _ lpRect As RECT) As Long
Private Declare Function ScreenToClient Lib "user32" _ (ByVal hwnd As Long, _ lpPoint As POINTAPI) As Long
Private Sub Command1_Click()
Dim pt As POINTAPI Dim rc As RECT Dim cwidth As Long Dim newHeight As Long Dim oldScaleMode As Long Dim numItemsToDisplay As Long Dim itemHeight As Long
'how many items should appear in the dropdown? numItemsToDisplay = 16 Label1.Caption = "Items displayed = " & numItemsToDisplay
'Save the current form scalemode, then 'switch to pixels oldScaleMode = Form09.ScaleMode Form09.ScaleMode = vbPixels
'the width of the combo, used below cwidth = Combo1.Width
'get the system height of a single 'combo box list item itemHeight = SendMessage(Combo1.hwnd, CB_GETITEMHEIGHT, 0, ByVal 0)
'Calculate the new height of the combo box. This 'is the number of items times the item height 'plus two. The 'plus two' is required to allow 'the calculations to take into account the size 'of the edit portion of the combo as it relates 'to item height. In other words, even if the 'combo is only 21 px high (315 twips), if the 'item height is 13 px per item (as it is with 'small fonts), we need to use two items to 'achieve this height. newHeight = itemHeight * (numItemsToDisplay + 2)
'get the co-ordinates of the combo box 'relative to the screen Call GetWindowRect(Combo1.hwnd, rc) pt.X = rc.Left pt.Y = rc.Top
'then translate into co-ordinates 'relative to the form. Call ScreenToClient(Form09.hwnd, pt)
'using the values returned and set above, 'call MoveWindow to reposition the combo box Call MoveWindow(Combo1.hwnd, pt.X, pt.Y, Combo1.Width, newHeight, True)
'it's done, so show the new combo height Call SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, True, ByVal 0)
'restore the original form scalemode 'before leaving Form09.ScaleMode = oldScaleMode
End Sub
"Daniel AUBRY" a écrit dans le message de news:44ed90db$0$1730$
Bonjour à tous,
comme dit dans le titre, je cherche à paramétrer le nombre déléments visivles dans une liste déroulante. En fait je cherche surtout à l'agrandir.
Si quelqu'un a une piste.........
D'avance, merci.
Dany
Trouvé dans un prog français, reprenant lui même des données sur mvps.org
'The Visual Basic combo box dropdown - unlike its C counterpart -
'is limited to displaying only eight items.
'This page shows how to change the dropdown height to any number greater
than eight.
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
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 Declare Function MoveWindow Lib "user32" _
(ByVal hwnd As Long, _
ByVal X As Long, ByVal Y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal bRepaint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" _
(ByVal hwnd As Long, _
lpRect As RECT) As Long
Private Declare Function ScreenToClient Lib "user32" _
(ByVal hwnd As Long, _
lpPoint As POINTAPI) As Long
Private Sub Command1_Click()
Dim pt As POINTAPI
Dim rc As RECT
Dim cwidth As Long
Dim newHeight As Long
Dim oldScaleMode As Long
Dim numItemsToDisplay As Long
Dim itemHeight As Long
'how many items should appear in the dropdown?
numItemsToDisplay = 16
Label1.Caption = "Items displayed = " & numItemsToDisplay
'Save the current form scalemode, then
'switch to pixels
oldScaleMode = Form09.ScaleMode
Form09.ScaleMode = vbPixels
'the width of the combo, used below
cwidth = Combo1.Width
'get the system height of a single
'combo box list item
itemHeight = SendMessage(Combo1.hwnd, CB_GETITEMHEIGHT, 0, ByVal 0)
'Calculate the new height of the combo box. This
'is the number of items times the item height
'plus two. The 'plus two' is required to allow
'the calculations to take into account the size
'of the edit portion of the combo as it relates
'to item height. In other words, even if the
'combo is only 21 px high (315 twips), if the
'item height is 13 px per item (as it is with
'small fonts), we need to use two items to
'achieve this height.
newHeight = itemHeight * (numItemsToDisplay + 2)
'get the co-ordinates of the combo box
'relative to the screen
Call GetWindowRect(Combo1.hwnd, rc)
pt.X = rc.Left
pt.Y = rc.Top
'then translate into co-ordinates
'relative to the form.
Call ScreenToClient(Form09.hwnd, pt)
'using the values returned and set above,
'call MoveWindow to reposition the combo box
Call MoveWindow(Combo1.hwnd, pt.X, pt.Y, Combo1.Width, newHeight, True)
'it's done, so show the new combo height
Call SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, True, ByVal 0)
'restore the original form scalemode
'before leaving
Form09.ScaleMode = oldScaleMode
End Sub
"Daniel AUBRY" <mail@daniel-aubry.com> a écrit dans le message de
news:44ed90db$0$1730$626a54ce@news.free.fr...
Bonjour à tous,
comme dit dans le titre, je cherche à paramétrer le
nombre déléments visivles dans une liste déroulante.
En fait je cherche surtout à l'agrandir.
'The Visual Basic combo box dropdown - unlike its C counterpart - 'is limited to displaying only eight items. 'This page shows how to change the dropdown height to any number greater than eight.
Private Type POINTAPI X As Long Y As Long End Type
Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
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 Declare Function MoveWindow Lib "user32" _ (ByVal hwnd As Long, _ ByVal X As Long, ByVal Y As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long, _ ByVal bRepaint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" _ (ByVal hwnd As Long, _ lpRect As RECT) As Long
Private Declare Function ScreenToClient Lib "user32" _ (ByVal hwnd As Long, _ lpPoint As POINTAPI) As Long
Private Sub Command1_Click()
Dim pt As POINTAPI Dim rc As RECT Dim cwidth As Long Dim newHeight As Long Dim oldScaleMode As Long Dim numItemsToDisplay As Long Dim itemHeight As Long
'how many items should appear in the dropdown? numItemsToDisplay = 16 Label1.Caption = "Items displayed = " & numItemsToDisplay
'Save the current form scalemode, then 'switch to pixels oldScaleMode = Form09.ScaleMode Form09.ScaleMode = vbPixels
'the width of the combo, used below cwidth = Combo1.Width
'get the system height of a single 'combo box list item itemHeight = SendMessage(Combo1.hwnd, CB_GETITEMHEIGHT, 0, ByVal 0)
'Calculate the new height of the combo box. This 'is the number of items times the item height 'plus two. The 'plus two' is required to allow 'the calculations to take into account the size 'of the edit portion of the combo as it relates 'to item height. In other words, even if the 'combo is only 21 px high (315 twips), if the 'item height is 13 px per item (as it is with 'small fonts), we need to use two items to 'achieve this height. newHeight = itemHeight * (numItemsToDisplay + 2)
'get the co-ordinates of the combo box 'relative to the screen Call GetWindowRect(Combo1.hwnd, rc) pt.X = rc.Left pt.Y = rc.Top
'then translate into co-ordinates 'relative to the form. Call ScreenToClient(Form09.hwnd, pt)
'using the values returned and set above, 'call MoveWindow to reposition the combo box Call MoveWindow(Combo1.hwnd, pt.X, pt.Y, Combo1.Width, newHeight, True)
'it's done, so show the new combo height Call SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, True, ByVal 0)
'restore the original form scalemode 'before leaving Form09.ScaleMode = oldScaleMode
End Sub
"Daniel AUBRY" a écrit dans le message de news:44ed90db$0$1730$
Bonjour à tous,
comme dit dans le titre, je cherche à paramétrer le nombre déléments visivles dans une liste déroulante. En fait je cherche surtout à l'agrandir.
Si quelqu'un a une piste.........
D'avance, merci.
Dany
Daniel AUBRY
Impeccable, exactement ce dont j'ai besoin. Grand merci.
Dany
"Driss HANIB" a écrit dans le message de news:
Trouvé dans un prog français, reprenant lui même des données sur mvps.org
'The Visual Basic combo box dropdown - unlike its C counterpart - 'is limited to displaying only eight items. 'This page shows how to change the dropdown height to any number greater than eight.
Private Type POINTAPI X As Long Y As Long End Type
Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
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 Declare Function MoveWindow Lib "user32" _ (ByVal hwnd As Long, _ ByVal X As Long, ByVal Y As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long, _ ByVal bRepaint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" _ (ByVal hwnd As Long, _ lpRect As RECT) As Long
Private Declare Function ScreenToClient Lib "user32" _ (ByVal hwnd As Long, _ lpPoint As POINTAPI) As Long
Private Sub Command1_Click()
Dim pt As POINTAPI Dim rc As RECT Dim cwidth As Long Dim newHeight As Long Dim oldScaleMode As Long Dim numItemsToDisplay As Long Dim itemHeight As Long
'how many items should appear in the dropdown? numItemsToDisplay = 16 Label1.Caption = "Items displayed = " & numItemsToDisplay
'Save the current form scalemode, then 'switch to pixels oldScaleMode = Form09.ScaleMode Form09.ScaleMode = vbPixels
'the width of the combo, used below cwidth = Combo1.Width
'get the system height of a single 'combo box list item itemHeight = SendMessage(Combo1.hwnd, CB_GETITEMHEIGHT, 0, ByVal 0)
'Calculate the new height of the combo box. This 'is the number of items times the item height 'plus two. The 'plus two' is required to allow 'the calculations to take into account the size 'of the edit portion of the combo as it relates 'to item height. In other words, even if the 'combo is only 21 px high (315 twips), if the 'item height is 13 px per item (as it is with 'small fonts), we need to use two items to 'achieve this height. newHeight = itemHeight * (numItemsToDisplay + 2)
'get the co-ordinates of the combo box 'relative to the screen Call GetWindowRect(Combo1.hwnd, rc) pt.X = rc.Left pt.Y = rc.Top
'then translate into co-ordinates 'relative to the form. Call ScreenToClient(Form09.hwnd, pt)
'using the values returned and set above, 'call MoveWindow to reposition the combo box Call MoveWindow(Combo1.hwnd, pt.X, pt.Y, Combo1.Width, newHeight, True)
'it's done, so show the new combo height Call SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, True, ByVal 0)
'restore the original form scalemode 'before leaving Form09.ScaleMode = oldScaleMode
End Sub
"Daniel AUBRY" a écrit dans le message de news:44ed90db$0$1730$
Bonjour à tous,
comme dit dans le titre, je cherche à paramétrer le nombre déléments visivles dans une liste déroulante. En fait je cherche surtout à l'agrandir.
Si quelqu'un a une piste.........
D'avance, merci.
Dany
Impeccable, exactement ce dont j'ai besoin.
Grand merci.
Dany
"Driss HANIB" <dhanib@club-internet.fr> a écrit dans le message de news:
u6mYjECyGHA.3488@TK2MSFTNGP02.phx.gbl...
Trouvé dans un prog français, reprenant lui même des données sur mvps.org
'The Visual Basic combo box dropdown - unlike its C counterpart -
'is limited to displaying only eight items.
'This page shows how to change the dropdown height to any number greater
than eight.
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
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 Declare Function MoveWindow Lib "user32" _
(ByVal hwnd As Long, _
ByVal X As Long, ByVal Y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal bRepaint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" _
(ByVal hwnd As Long, _
lpRect As RECT) As Long
Private Declare Function ScreenToClient Lib "user32" _
(ByVal hwnd As Long, _
lpPoint As POINTAPI) As Long
Private Sub Command1_Click()
Dim pt As POINTAPI
Dim rc As RECT
Dim cwidth As Long
Dim newHeight As Long
Dim oldScaleMode As Long
Dim numItemsToDisplay As Long
Dim itemHeight As Long
'how many items should appear in the dropdown?
numItemsToDisplay = 16
Label1.Caption = "Items displayed = " & numItemsToDisplay
'Save the current form scalemode, then
'switch to pixels
oldScaleMode = Form09.ScaleMode
Form09.ScaleMode = vbPixels
'the width of the combo, used below
cwidth = Combo1.Width
'get the system height of a single
'combo box list item
itemHeight = SendMessage(Combo1.hwnd, CB_GETITEMHEIGHT, 0, ByVal 0)
'Calculate the new height of the combo box. This
'is the number of items times the item height
'plus two. The 'plus two' is required to allow
'the calculations to take into account the size
'of the edit portion of the combo as it relates
'to item height. In other words, even if the
'combo is only 21 px high (315 twips), if the
'item height is 13 px per item (as it is with
'small fonts), we need to use two items to
'achieve this height.
newHeight = itemHeight * (numItemsToDisplay + 2)
'get the co-ordinates of the combo box
'relative to the screen
Call GetWindowRect(Combo1.hwnd, rc)
pt.X = rc.Left
pt.Y = rc.Top
'then translate into co-ordinates
'relative to the form.
Call ScreenToClient(Form09.hwnd, pt)
'using the values returned and set above,
'call MoveWindow to reposition the combo box
Call MoveWindow(Combo1.hwnd, pt.X, pt.Y, Combo1.Width, newHeight, True)
'it's done, so show the new combo height
Call SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, True, ByVal 0)
'restore the original form scalemode
'before leaving
Form09.ScaleMode = oldScaleMode
End Sub
"Daniel AUBRY" <mail@daniel-aubry.com> a écrit dans le message de
news:44ed90db$0$1730$626a54ce@news.free.fr...
Bonjour à tous,
comme dit dans le titre, je cherche à paramétrer le
nombre déléments visivles dans une liste déroulante.
En fait je cherche surtout à l'agrandir.
'The Visual Basic combo box dropdown - unlike its C counterpart - 'is limited to displaying only eight items. 'This page shows how to change the dropdown height to any number greater than eight.
Private Type POINTAPI X As Long Y As Long End Type
Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
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 Declare Function MoveWindow Lib "user32" _ (ByVal hwnd As Long, _ ByVal X As Long, ByVal Y As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long, _ ByVal bRepaint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" _ (ByVal hwnd As Long, _ lpRect As RECT) As Long
Private Declare Function ScreenToClient Lib "user32" _ (ByVal hwnd As Long, _ lpPoint As POINTAPI) As Long
Private Sub Command1_Click()
Dim pt As POINTAPI Dim rc As RECT Dim cwidth As Long Dim newHeight As Long Dim oldScaleMode As Long Dim numItemsToDisplay As Long Dim itemHeight As Long
'how many items should appear in the dropdown? numItemsToDisplay = 16 Label1.Caption = "Items displayed = " & numItemsToDisplay
'Save the current form scalemode, then 'switch to pixels oldScaleMode = Form09.ScaleMode Form09.ScaleMode = vbPixels
'the width of the combo, used below cwidth = Combo1.Width
'get the system height of a single 'combo box list item itemHeight = SendMessage(Combo1.hwnd, CB_GETITEMHEIGHT, 0, ByVal 0)
'Calculate the new height of the combo box. This 'is the number of items times the item height 'plus two. The 'plus two' is required to allow 'the calculations to take into account the size 'of the edit portion of the combo as it relates 'to item height. In other words, even if the 'combo is only 21 px high (315 twips), if the 'item height is 13 px per item (as it is with 'small fonts), we need to use two items to 'achieve this height. newHeight = itemHeight * (numItemsToDisplay + 2)
'get the co-ordinates of the combo box 'relative to the screen Call GetWindowRect(Combo1.hwnd, rc) pt.X = rc.Left pt.Y = rc.Top
'then translate into co-ordinates 'relative to the form. Call ScreenToClient(Form09.hwnd, pt)
'using the values returned and set above, 'call MoveWindow to reposition the combo box Call MoveWindow(Combo1.hwnd, pt.X, pt.Y, Combo1.Width, newHeight, True)
'it's done, so show the new combo height Call SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, True, ByVal 0)
'restore the original form scalemode 'before leaving Form09.ScaleMode = oldScaleMode
End Sub
"Daniel AUBRY" a écrit dans le message de news:44ed90db$0$1730$
Bonjour à tous,
comme dit dans le titre, je cherche à paramétrer le nombre déléments visivles dans une liste déroulante. En fait je cherche surtout à l'agrandir.