Some styles could be changed using GetWindowLong() / SetWindowLong(), but not all. By example,
DWORD style = GetWindowLong(ctrlHwnd, GWL_STYLE);
style |= ES_READONLY;
SetWindowLong(ctrlHwnd, GWL_STYLE, style);
There is a dirty trick for the case of styles that are not allowed to be changed, you can maintain 2 separated controls, you can hide one and show the other, when switching you must copy entire text between both.
Main Topics
Browse All Topics





by: nonubikPosted on 2005-06-14 at 03:38:01ID: 14209671
I'm afraid the style cannot be changed. MSDN states "After the control has been created, these styles cannot be modified, except as noted. " And there's no exception for ES_AUTOHSCROLL http://msdn.microsoft.com/ library/de fault.asp? url=/libra ry/ en-us/s hellcc/pla tform/comm ctls/editc ontrols/ ed itcontrolr eference/e ditcontrol styles.asp