Page 1 sur 1

[C] J'ai besoin d'un UpDown dans un ComboBox

Posté : mar. 21 avr. 2020 12:50
par Anthony
Bonjour à tous,

Comme le titre l'annonce j'ai besoin d'un UpDown dans une ComboBox, Tada!!!
Combo with UpDown.jpg
Mais c'est une erreur qui me produit cet effet, ce n'est pas un montage :?
Voici ce qui créé mon combo.

Code : Tout sélectionner

$Ex_Object = GUICtrlCreateCombo( "", $Bar_Ex_X, $Bar_Ex_Y, $Bar_Ex_W, $Bar_Ex_H, BitOR( $Style, $Ex_Style))
Et l’erreur qui fait apparaître un UpDown comme on peut le voir sur la capture d'écran avec un ComboBox :shock:

Code : Tout sélectionner

If $Style <> "" Or $Ex_Style <> "" Then GUICtrlSetStyle( $Ex_Object, $Style, $Ex_Style)
Je me pose la question...? Quel est ce style ? :roll:

Voici le bout de code pour tester :mrgreen:

Code : Tout sélectionner

#NoTrayIcon
#include <GuiConstantsEx.au3>
#include <ComboConstants.au3>
#include <WindowsConstants.au3>

Local $hGUI = GUICreate("Combo with UpDown", 320, 200, -1, -1) ; create main gui window
GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU))

$Bar_Ex_X	= 10
$Bar_Ex_Y	= 10
$Bar_Ex_W	= 300
$Bar_Ex_H	= 20
$Style		= $WS_VSCROLL
$Ex_Style	= ""
$Ex_Object = GUICtrlCreateCombo( "", $Bar_Ex_X, $Bar_Ex_Y, $Bar_Ex_W, $Bar_Ex_H, BitOR( $Style, $Ex_Style))
GUICtrlSetData( $Ex_Object, "A|B|Combo|C|D", "Combo")

If $Style <> "" Or $Ex_Style <> "" Then GUICtrlSetStyle( $Ex_Object, $Style, $Ex_Style)

GUISetState( @SW_SHOW)

While 1
   Switch GUIGetMsg()
	  Case $GUI_EVENT_CLOSE
		 Exit
   EndSwitch
WEnd

Re: [..] J'ai besoin d'un UpDown dans un ComboBox

Posté : mar. 21 avr. 2020 13:24
par Nine
Tu peux appliquer ce style $WS_VSCROLL à n'importe quel contrôle (label, button, input, checkbox, combo, etc.), il va s'afficher. Mais il n'a aucun sens avec ces contrôles sauf pour Edit par exemple. Puisqu'il n'a aucun sens, il n'a aucun effet...

Re: [..] J'ai besoin d'un UpDown dans un ComboBox  

Posté : mar. 21 avr. 2020 18:26
par mikell
Comme le dit Nine ton machin c'est pas un updown, c'est une barre de scroll
Quel rapport avec le titre du sujet ?

Re: [..] J'ai besoin d'un UpDown dans un ComboBox

Posté : mer. 22 avr. 2020 04:37
par Anthony
Bonjour et merci à tous les deux,

OK mon machin est pourri :P , si c'est pas indispensable tu crois pas qu'il serai bien de le supprimer ce fil de discussion mikell ?