Entry-Field Styles

An entry field has a style that determines how it appears and behaves. An application specifies the style in either the WinCreateWindow function or the ENTRYFIELD statement in a resource-definition file. An application can specify a combination of the following styles for an entry field.

┌───────────────┬─────────────────────────────────────────────┐
│Style          │Description                                  │
├───────────────┼─────────────────────────────────────────────┤
│ES_ANY         │Allows the entry-field text to contain a     │
│               │mixture of double-byte and single-byte       │
│               │characters.                                  │
├───────────────┼─────────────────────────────────────────────┤
│ES_AUTOSCROLL  │Automatically scrolls text horizontally to   │
│               │show the insertion point.                    │
├───────────────┼─────────────────────────────────────────────┤
│ES_AUTOSIZE    │Automatically sets the size of the entry     │
│               │field, based on the width of the field's text│
│               │string and the metrics of the current system │
│               │font.  This style can set the width, height, │
│               │or both-whichever has a value of -1 in the   │
│               │WinCreateWindow function or                  │
│               │resource-definition file.  This style affects│
│               │only the initial size of the entry field; it │
│               │does not adjust the size as the font or      │
│               │text-string width changes.                   │
├───────────────┼─────────────────────────────────────────────┤
│ES_AUTOTAB     │Automatically moves the cursor to the next   │
│               │control window when the user enters the      │
│               │maximum number of characters.                │
├───────────────┼─────────────────────────────────────────────┤
│ES_CENTER      │Centers text within the entry field.         │
├───────────────┼─────────────────────────────────────────────┤
│ES_DBCS        │Specifies that the entry-field text consist  │
│               │of double-byte characters only.              │
├───────────────┼─────────────────────────────────────────────┤
│ES_LEFT        │Left-aligns text within the entry field.     │
├───────────────┼─────────────────────────────────────────────┤
│ES_MARGIN      │Draws a border around the entry field.  The  │
│               │border is 1/2-character wide and             │
│               │1/4-character high.  Without this style, the │
│               │application draws no border around the entry │
│               │field.  The width of the entry-field         │
│               │rectangle is increased on all sides by the   │
│               │width of this margin.  After an entry field  │
│               │with the ES_MARGIN style is created, the     │
│               │WinQueryWindowRect function returns a larger │
│               │rectangle that includes this margin and whose│
│               │origin, therefore, is different from the     │
│               │origin specified when the entry field was    │
│               │created. If an application does not adjust   │
│               │for this size difference when moving or      │
│               │sizing an entry field, the entry field       │
│               │becomes larger after each moving and sizing  │
│               │operation.                                   │
├───────────────┼─────────────────────────────────────────────┤
│ES_MIXED       │Allows the entry-field text to contain a     │
│               │mixture of single-byte and double-byte       │
│               │characters.  Unlike the ES_ANY style, this   │
│               │style lets ASCII DBCS data be converted to   │
│               │EBCDIC DBCS data without causing an overflow │
│               │condition.                                   │
├───────────────┼─────────────────────────────────────────────┤
│ES_READONLY    │Prevents the user from entering or editing   │
│               │text in the entry field.                     │
├───────────────┼─────────────────────────────────────────────┤
│ES_RIGHT       │Right-aligns text within the entry field.    │
├───────────────┼─────────────────────────────────────────────┤
│ES_SBCS        │Specifies that the entry-field text must     │
│               │consist of single-byte characters only.      │
├───────────────┼─────────────────────────────────────────────┤
│ES_UNREADABLE  │Displays each character as an asterisk (*).  │
│               │This style is useful when obtaining a        │
│               │password from the user.                      │
└───────────────┴─────────────────────────────────────────────┘


[Back: About Entry Fields]
[Next: Entry-Field Notification Codes]