[..] Problème d'ajout de produit

Aide et conseils concernant AutoIt et ses outils.
Règles du forum
.
Répondre
9aylas
Niveau 1
Niveau 1
Messages : 7
Enregistré le : lun. 30 janv. 2017 11:40
Status : Hors ligne

[..] Problème d'ajout de produit

#1

Message par 9aylas »

salut a tous j'ai un ptit probleme
regarder le code
j'ai pas pu ajouter tout les info sur l'Edit :cry:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Manager", 373, 281, 361, 120)
GUISetBkColor(0x000000)
$produit = GUICtrlCreateInput("Nom Du Produit", 8, 8, 137, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$WS_BORDER))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$prix = GUICtrlCreateInput("Prix De Vente", 144, 8, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_NUMBER,$WS_BORDER))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008000)
$date = GUICtrlCreateInput("Date", 240, 8, 65, 21, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetColor(-1, 0x000080)
$add = GUICtrlCreateButton("Ajouter", 312, 8, 57, 129)
$Button2 = GUICtrlCreateButton("Exit", 312, 144, 57, 129)

$Edit1 = GUICtrlCreateEdit("", 8, 32, 297, 241, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
   
 Case $add
   $info= GUICtrlRead($produit)
   GUICtrlSetData($Edit1, $info)
 Case $GUI_EVENT_CLOSE
 Exit
 Case $Button2
 Exit
   Case $Form1
   EndSwitch
WEnd
Avatar du membre
parazitenew
Niveau 7
Niveau 7
Messages : 310
Enregistré le : sam. 10 déc. 2011 15:08
Localisation : Algerie
Status : Hors ligne

Re: [..] problem d'ajout de produit

#2

Message par parazitenew »

Bonjour,
$info= GUICtrlRead($produit)
    GUICtrlSetData($Edit1, $info)
Ceci explique ton problème. Tu ne fais qu'insérer ce qui est saisie dans le champ produit. Si tu veux afficher le prix et la date aussi, alors il faut procéder de la même manière, à savoir lire et mettre dans des variables le contenu des autres inputs.
9aylas
Niveau 1
Niveau 1
Messages : 7
Enregistré le : lun. 30 janv. 2017 11:40
Status : Hors ligne

Re: [..] problem d'ajout de produit

#3

Message par 9aylas »

sa marche pas , quand j'ajoute les autre variables , rien est affiché sur l'Edit
Avatar du membre
Nicoloquinte
Niveau 4
Niveau 4
Messages : 70
Enregistré le : ven. 15 juil. 2016 11:57
Status : Hors ligne

Re: [..] problem d'ajout de produit

#4

Message par Nicoloquinte »

Heu Je crois que j'ai compris :mrgreen:
Mais tu n'avait pas formulé cela dans ta question au début

Mais du coup j'ai fait tout ton boulot ....................... :mrgreen:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>


$Aff = ""
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Manager", 373, 281, 361, 120)
GUISetBkColor(0x000000)
$produit = GUICtrlCreateInput("Nom Du Produit", 8, 8, 137, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$WS_BORDER))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$prix = GUICtrlCreateInput("Prix De Vente", 144, 8, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_NUMBER,$WS_BORDER))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008000)
$date = GUICtrlCreateInput("Date", 240, 8, 65, 21, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetColor(-1, 0x000080)
$add = GUICtrlCreateButton("Ajouter", 312, 8, 57, 129)
$Button2 = GUICtrlCreateButton("Exit", 312, 144, 57, 129)

$Edit1 = GUICtrlCreateEdit("", 8, 32, 297, 241, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

 Case $add
   $Aff =  GUICtrlRead($Edit1)&@CRLF&GUICtrlRead($produit)&"    "&GUICtrlRead($prix)&"   €"&"     "&GUICtrlRead($date)
    GUICtrlSetData($Edit1, $Aff)
 Case $GUI_EVENT_CLOSE
 Exit
 Case $Button2
 Exit
   Case $Form1
   EndSwitch
WEnd
Nico ¤_¤
Avatar du membre
walkson
Modérateur
Modérateur
Messages : 1037
Enregistré le : ven. 12 août 2011 19:49
Localisation : Hurepoix
Status : Hors ligne

Re: [..] problem d'ajout de produit

#5

Message par walkson »

GUICtrlSetData ( controlID, data [, default] )

controlID The control identifier (controlID) as returned by a GUICtrlCreate...() function, or -1 for the last created control.
data Combo, List, ListView, ListViewItem: An Opt("GUIDataSeparatorChar",...) separated list of items.
Progress: The percentage.
Slider: The value.
Button, Checkbox, Combo, Edit, Group, Input, Label, List, Menu, MenuItem, Radio, TabItem, TreeViewItem: Replaces the text.
Date : The date or time depending the style of the control and the regional settings.
Dummy: The value.
default [optional]
Combo, List: The default value.
Edit, Input: If non-empty (""), the string is inserted at the current insertion point (caret).
Case $add
        $info= GUICtrlRead($produit) & @CRLF
        GUICtrlSetData($Edit1, $info,1)
        $info= GUICtrlRead($prix) & @CRLF
        GUICtrlSetData($Edit1, $info,1)
        $info= GUICtrlRead($date) & @CRLF
        GUICtrlSetData($Edit1, $info,1)
      GUICtrlSetData($Edit1, @CRLF,1)
      ;ou
      $info = GUICtrlRead($produit) &"> "& GUICtrlRead($prix) &"> "& GUICtrlRead($date) & @CRLF
      GUICtrlSetData($Edit1, $info,1)
      GUICtrlSetData($Edit1, @CRLF,1)
      ;ou
      $info= GUICtrlRead($produit) & @TAB
        GUICtrlSetData($Edit1, $info,1)
        $info= GUICtrlRead($prix) & @TAB
        GUICtrlSetData($Edit1, $info,1)
      $info= GUICtrlRead($date) & @CRLF
        GUICtrlSetData($Edit1, $info,1)
:mrgreen:
Cordialement,
Walkson
"Horas non numero nisi serenas " Le canon de midi
(Je ne compte que les heures heureuses)
Avatar du membre
A2Energie
Niveau 5
Niveau 5
Messages : 143
Enregistré le : ven. 15 nov. 2013 20:22
Status : Hors ligne

Re: [..] problem d'ajout de produit

#6

Message par A2Energie »

Bonjour 9aylas,

Pourrais tu revoir certaines choses qui permettent une bonne entente et plus de clareté dans tes posts,

1/ Renommer ton précédent post comme te le demande Tommy : https://www.autoitscript.fr/forum/viewt ... =3&t=14419
2/ Si le précédent post a été résolu l'indiquer : https://www.autoitscript.fr/forum/viewt ... f=35&t=595

Merci a toi et bon codes,
9aylas
Niveau 1
Niveau 1
Messages : 7
Enregistré le : lun. 30 janv. 2017 11:40
Status : Hors ligne

Re: [R] problem d'ajout de produit

#7

Message par 9aylas »

Ooooh merci a vous a l'infinie <3

c'es bon sa marche & j'ai ajouter de + le boutton enregistrer + éffacer le text mércyyyyyyy
Répondre