perathoner
Messages postés90Date d'inscriptiondimanche 5 novembre 2000StatutMembreDernière intervention26 juillet 2006
-
8 sept. 2005 à 16:00
perathoner
Messages postés90Date d'inscriptiondimanche 5 novembre 2000StatutMembreDernière intervention26 juillet 2006
-
9 sept. 2005 à 09:31
Posté le: Mer Sep 07, 2005 8:57 Sujet du message: Un pb de ComboBox !!!,
,
----
<HR>,
----
Bonjour à toutes et à tous...
Ben voilà une p'tite question.
Le bout de code suivant, permet de modifier l'apparence d'un ComboBox.
Ainsi, lorsque l'on click dessus, la taille s'adapte à la longueur du plus grand Item.
Ma question : Comment faire pour choisir soit le développement sur la droite ou sur la gauche ???
Merci d'avance..
'Ce code dans un module.
Private Const CB_GETLBTEXTLEN = &H149
Private Const CB_SHOWDROPDOWN = &H14F
Private Const CB_GETDROPPEDWIDTH = &H15F
Private Const CB_SETDROPPEDWIDTH = &H160
Private Const CB_MSGMAX = &H15B
Private Const CB_SETITEMHEIGHT = &H153
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
Public Sub LargeurCombo(hwnd As Long, largeur As Long)
SendMessage hwnd, CB_SETDROPPEDWIDTH, largeur, ByVal 0
End Sub
'Celui-ci dans le module de la Form.
Private Sub Form_Load()
Combo1.AddItem "Jean"
Combo1.AddItem "Pierre"
Combo1.AddItem "La largeur est de 350, pour diminuer oµ augmenter, changer ce chiffre."
perathoner
Messages postés90Date d'inscriptiondimanche 5 novembre 2000StatutMembreDernière intervention26 juillet 2006 8 sept. 2005 à 16:01
,
,
----
,
----
Bonjour à toutes et à tous...
Ben voilà une p'tite question.
Le bout de code suivant, permet de modifier l'apparence d'un ComboBox.
Ainsi, lorsque l'on click dessus, la taille s'adapte à la longueur du plus grand Item.
Ma question : Comment faire pour choisir soit le développement sur la droite ou sur la gauche ???
Merci d'avance..
'Ce code dans un module.
Private Const CB_GETLBTEXTLEN = &H149
Private Const CB_SHOWDROPDOWN = &H14F
Private Const CB_GETDROPPEDWIDTH = &H15F
Private Const CB_SETDROPPEDWIDTH = &H160
Private Const CB_MSGMAX = &H15B
Private Const CB_SETITEMHEIGHT = &H153
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
Public Sub LargeurCombo(hwnd As Long, largeur As Long)
SendMessage hwnd, CB_SETDROPPEDWIDTH, largeur, ByVal 0
End Sub
'Celui-ci dans le module de la Form.
Private Sub Form_Load()
Combo1.AddItem "Jean"
Combo1.AddItem "Pierre"
Combo1.AddItem "La largeur est de 350, pour diminuer oµ augmenter, changer ce chiffre."
perathoner
Messages postés90Date d'inscriptiondimanche 5 novembre 2000StatutMembreDernière intervention26 juillet 2006 8 sept. 2005 à 16:05
Sorry. j'ai fais un Ctrl C / Ctrl V ...
'Celui-ci dans le module de la Form.
Private Sub Command1_Click()
Me.Combo1.Left = Me.Combo1.Left - 100
End Sub
Private Sub Command2_Click()
Me.Combo1.Left = Me.Combo1.Left + 1000
End Sub
Private Sub Form_Load()
Combo1.AddItem "Jean"
Combo1.AddItem "Pierre"
'Combo1.AddItem "La largeur est de 350, pour diminuer ou augmenter, changer ce chiffre." '70 caractères
Combo1.AddItem "La largeur est de 350, pour diminuer ou augmenter, changer ce chiffre.La largeur est de 350, pour diminuer ou augmenter, changer ce chiffre." '140 caractères
'LargeurCombo Combo1.hwnd, 350
LargeurCombo Combo1.hwnd, 700
End Sub
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
Public Sub LargeurCombo(hwnd As Long, largeur As Long)
perathoner
Messages postés90Date d'inscriptiondimanche 5 novembre 2000StatutMembreDernière intervention26 juillet 2006 8 sept. 2005 à 16:58
Merci à toi Deluka.
Ah ouai tu crois qu'c'est pas possible ???
J'espère que tu te trompes !!!!
Même en utilisant les messages Window ???
Je sais qu'il y a plein de constantes pour les ComboBox !!!
Mais je ne connais pas leurs signification à toutes !!!
C'est pas toujours évident !!!
ALors...à vot bon coeur m'sô dam...si quelqu'un à une tite idée pour moi...
Merci d'avance..
Vous n’avez pas trouvé la réponse que vous recherchez ?
PCPT
Messages postés13272Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 201847 8 sept. 2005 à 17:39
salut
Public Const CB_ADDSTRING = &H143
Public Const CB_DELETESTRING = &H144
Public Const CB_DIR = &H145
Public Const CB_FINDSTRING = &H14C
Public Const CB_FINDSTRINGEXACT = &H158
Public Const CB_GETCOMBOBOXINFO = &H164
Public Const CB_GETCOUNT = &H146
Public Const CB_GETCURSEL = &H147
Public Const CB_GETDROPPEDCONTROLRECT = &H152
Public Const CB_GETDROPPEDSTATE = &H157
Public Const CB_GETDROPPEDWIDTH = &H15F
Public Const CB_GETEDITSEL = &H140
Public Const CB_GETEXTENDEDUI = &H156
Public Const CB_GETHORIZONTALEXTENT = &H15D
Public Const CB_GETITEMDATA = &H150
Public Const CB_GETITEMHEIGHT = &H154
Public Const CB_GETLBTEXT = &H148
Public Const CB_GETLBTEXTLEN = &H149
Public Const CB_GETLOCALE = &H15A
Public Const CB_GETTOPINDEX = &H15B
Public Const CB_INITSTORAGE = &H161
Public Const CB_INSERTSTRING = &H14A
Public Const CB_LIMITTEXT = &H141
Public Const CB_MSGMAX = &H15B
Public Const CB_MULTIPLEADDSTRING = &H163
Public Const CB_OKAY = 0
Public Const CB_RESETCONTENT = &H14B
Public Const CB_SELECTSTRING = &H14D
Public Const CB_SETCURSEL = &H14E
Public Const CB_SETDROPPEDWIDTH = &H160
Public Const CB_SETEDITSEL = &H142
Public Const CB_SETEXTENDEDUI = &H155
Public Const CB_SETHORIZONTALEXTENT = &H15E
Public Const CB_SETITEMDATA = &H151
Public Const CB_SETITEMHEIGHT = &H153
Public Const CB_SETLOCALE = &H159
Public Const CB_SETTOPINDEX = &H15C
Public Const CB_SHOWDROPDOWN = &H14F