Aide:GUICtrlCreateEdit.txt

De Wiki AutoIt Français
Aller à : navigation, rechercher

Document original V3.3.6.1 :

###Function###
GUICtrlCreateEdit

###Description###
Creates an Edit control for the GUI.

###Syntax###
GUICtrlCreateEdit ( "text", left, top [, width [, height [, style [, exStyle]]]] )


###Parameters###
@@ParamTable@@
text
	The text of the control.
left
	The left side of the control. If -1 is used then left will be computed according to <a href="AutoItSetOption.htm#GUICoordMode">GUICoordMode.
top
	The top of the control. If -1 is used then top will be computed according to <a href="AutoItSetOption.htm#GUICoordMode">GUICoordMode.
width
	[optional] The width of the control (default is the previously used width).
height
	[optional] The height of the control (default is the previously used height).
style
	[optional] Defines the style of the control. See <a href="../appendix/GUIStyles.htm#Edit">GUI Control Styles Appendix</a>.
	
	default ( -1) : $ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL
	forced styles : $ES_MULTILINE, $WS_TABSTOP only if not $ES_READONLY
exStyle
	[optional] Defines the extended style of the control. See <a href="../appendix/GUIStyles.htm#Extended">Extended Style Table</a>.
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	Returns the identifier (controlID) of the new control.
Failure:	Returns 0.
@@End@@


###Remarks###
To obtain the value of the control see <a href="GUICtrlRead.htm">GUICtrlRead</a>.
To set or change information in the control see <a href="GUICtrlUpdate Management.htm">GUICtrlUpdate...</a>.

To combine styles with the default style use <b>BitOr</b>($GUI_SS_DEFAULT_EDIT, newstyle,...).

If you want to drag & drop a filename onto this control just add the <a href="../appendix/GUIStyles.htm#Extended">WS_EX_ACCEPTFILES extended style</a> on the <a href="GUICreate.htm">GUICreate()</a> and set the state to $GUI_DROPACCEPTED.
Multiple selected files will be dropped as separate lines.

To use the values specified above you must #include <EditConstants.au3> in your script.

Default resizing is $GUI_DOCKAUTO size and position will occur.

Creating a RichEdit control is too complex so it will not be included as a basic control.
You have to use the GuiCtrlCreateObj. See the second example if you need to have a RichEdit control.


###Related###
GUICoordMode (Option), GUICtrlSetData, GUICtrlSetState, GUICtrlSetLimit, GUIGetMsg, GUICtrlRead


###Example###
@@IncludeExample@@


Document traduit V3.3.6.1 :

###Function###
GUICtrlCreateEdit

###Description###
Crée un contrôle Edit pour l'interface graphique.

###Syntax###
GUICtrlCreateEdit ( "text", left, top [, width [, height [, style [, exStyle]]]] )


###Parameters###
@@ParamTable@@
text
	Le texte du contrôle.
left
	La position en partant de la gauche de la fenêtre. Si vous utilisez -1, la position sera calculé en fonction de <a href="AutoItSetOption.htm#GUICoordMode">GUICoordMode</a>.
top
	La position en partant du sommet de le fenêtre. Si vous utilisez -1, la position sera calculé en fonction de <a href="AutoItSetOption.htm#GUICoordMode">GUICoordMode</a>.
width
	[optionnel] La largeur du contrôle (par défaut est la largeur utilisée précédemment).
height
	[optionnel] La hauteur du contrôle (par défaut est la hauteur utilisée précédemment).
style
	Définit le style du contrôle. Voir l'<a href="../appendix/GUIStyles.htm#Edit">annexe de styles de contrôle GUI</a>.
	
	défaut ( -1) : $ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL
	styles forcés : $ES_MULTILINE, $WS_TABSTOP seulement sans $ES_READONLY
exStyle
	[optionnel] Définit le style étendu du contrôle. Voir la <a href="../appendix/GUIStyles.htm#Extended">Table des styles étendus</a>.
@@End@@

###ReturnValue###
@@ReturnTable@@
Succès:	Retourne l'identifiant (ID du contrôle) du nouveau contrôle.
Échec:	Retourne 0.
@@End@@


###Remarks###
Pour obtenir la valeur du contrôle, voir <a href="GUICtrlRead.htm">GUICtrlRead</a>.
Pour définir ou modifier des informations dans le contrôle, voir <a href="GUICtrlUpdate Management.htm">GUICtrlUpdate...</a>.

Pour combiner des styles avec le style par défaut, utilisez <b>BitOr</b>($GUI_SS_DEFAULT_EDIT, nouveau style,...).

Si vous souhaitez glisser et déposer (drag & drop) un nom de fichier sur ce contrôle suffit d'ajouter le <a href="../appendix/GUIStyles.htm#Extended">style étendu WS_EX_ACCEPTFILES</a> dans <a href="GUICreate.htm">GUICreate()</a> et définir l'état à $GUI_DROPACCEPTED.
Si plusieurs fichiers sont sélectionnés , ils seront déposés sur des lignes distinctes.

Pour utiliser les valeurs indiquées ci-dessus, vous devez inclure &lt;EditConstants.au3&gt; dans votre script.

Le redimensionnement par défaut est $GUI_DOCKAUTO, la taille et la position seront modifiés.

La création d'un contrôle RichEdit est trop complexe donc ne sera pas inclus dans un contrôle de base.
Vous devez utiliser GuiCtrlCreateObj. Voir le second exemple, si vous avez besoin d'avoir un contrôle RichEdit.


###Related###
GUICoordMode (Option), GUICtrlSetData, GUICtrlSetState, GUICtrlSetLimit, GUIGetMsg, GUICtrlRead


###Example###
@@IncludeExample@@


Traducteur : TT22

Contributeurs (pour les modifications avant le Wiki) :