The four parameters of stylebits are AddBit, RemoveBit, AddExtendedBit, RemoveExtendedBit. For a review of these four parameters, and an introduction to Stylebits in general, please view Stylebits - Windows.
Stylebits and Formatted Text
Many of the stylebits commands used with windows and textboxes can also be used with statictext controls. Since statictext doesn't accept user input, most of the stylebits effects involve text formatting and borders. Statictext can be justified horizontally using these commands -
_ES_LEFT
_ES_CENTER
_ES_RIGHT
Statictext can also be centered vertically using the command -
_SS_CENTERIMAGE
It is possible to create a nice etched look in your text using the command -
_WS_DISABLED
Use this strategy with caution, though. Any control disabled with the stylebits will require an API call to cause the statictext to later become enabled. The same look can be achieved using the native Liberty BASIC command !Disable and affords the programmer the opportunity to normalize the text look using !Enable later in the code.
There are some very interesting visual effects that can be achieved using a stylebits created border around your statictext.
Stylebits
_WS_DLGFRAME, 0, 0, 0
.....
Raised Background
0, 0, _WS_EX_STATICEDGE, 0
.....
Slightly Recessed Background
0, 0, _WS_EX_CLIENTEDGE, 0
.....
Deeper Recessed Background
0, 0, _WS_EX_STATICEDGE or _WS_EX_CLIENTEDGE, 0
.....
Double Recessed Background
_WS_BORDER, 0, 0, 0
.....
Thin Line Border
0, 0, _WS_EX_DLGMODALFRAME or _WS_EX_CLIENTEDGE, 0
.....
Raised Frame
_WS_THICKFRAME, 0, _WS_EX_DLGMODALFRAME or _WS_EX_CLIENTEDGE, 0
.....
Double Raised Frame
These are just some examples of what you can do with stylebits and statictext. With experimentation, you may find more.
A List of Stylebits
You can get a list of all dwStyles and dwExStyles available with the Stylebits command at the MSDN Library Center.
Reviewing the Stylebits Parameters
The four parameters of stylebits are AddBit, RemoveBit, AddExtendedBit, RemoveExtendedBit. For a review of these four parameters, and an introduction to Stylebits in general, please view Stylebits - Windows.
Stylebits and Formatted Text
Many of the stylebits commands used with windows and textboxes can also be used with statictext controls. Since statictext doesn't accept user input, most of the stylebits effects involve text formatting and borders. Statictext can be justified horizontally using these commands -
Statictext can also be centered vertically using the command -
It is possible to create a nice etched look in your text using the command -
Use this strategy with caution, though. Any control disabled with the stylebits will require an API call to cause the statictext to later become enabled. The same look can be achieved using the native Liberty BASIC command !Disable and affords the programmer the opportunity to normalize the text look using !Enable later in the code.
There are some very interesting visual effects that can be achieved using a stylebits created border around your statictext.
These are just some examples of what you can do with stylebits and statictext. With experimentation, you may find more.
A List of Stylebits
You can get a list of all dwStyles and dwExStyles available with the Stylebits command at the MSDN Library Center.