There are 15 definable rectangle/box styles, which you can select from for the appearance of each textbox box or rectangle slice. Box styles also are used for various boxes in builtin menus, as documented below. There's currently no way to change which styles are used for builtin menus.
The 'edge' color is used to draw a one-pixel wide line around the outside, even if you set a box border image (spriteset), which will be drawn on top, usually hiding the line. You can set a rectangle slice to use a 'line' border which disables the box border sprites. Some builtin menus only use line borders.
The 'style' attribute of a rectangle slice refers to a box style, but the 'border style' attribute (e.g. set rect border) also refers to the border of a certain box style. You have to change a rect slice to "Border type: Spriteset" (in the slice editor) or use the set rect raw border command to directly set the slice's box border spriteset number.
Hard-coded box style uses
|Box style 0||The default menu (unless edited), Inventory, Spells background, Status background, Equip background and disabled slots, Team menu, Order menu, Save game selected save slot, Shops, Learnt spell message, file browser, battle captions, debug menus, and Pause screen.
|Box style 1||Load game selected save slot, Spells menu, Inventory. Certain multichoice prompts in Custom.|
|Box style 2||Spells menu (single thin line). Confirm to overwrite save slot, Joystick calibration, Script errors, Pop up messages in Custom and Game like the save & quit warning message.|
|Box style 3||Inventory description box, Status menu, Equip menu, Buy and Hire boxes, Sell description box. Certain prompts in Custom.|
|Box style 4-13||No built-in use.|
|Box style 14||Load & Save game boxes (if not selected) and new game/quit buttons; Quit screen.|
Also, style 0-7 edge colours are used in the zone editing mode of the map editor.