Older Version Newer Version

JanetTerra JanetTerra May 10, 2006

==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 - 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 - [[code format="vb"]] _ES_LEFT _ES_CENTER _ES_RIGHT [[code]] Statictext can also be centered vertically using the command - [[code format="vb"]] _SS_CENTERIMAGE [[code]] It is possible to create a nice etched look in your text using the command - [[code format="vb"]] _WS_DISABLED [[code]] 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 [[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_Styles_used_by_mfc.asp|MSDN Library Center]].