A RichEdit without any borders [Solved]
-
I'm trying to create a RichEdit without any borders tried to set off ES_SUNKEN, WS_EX_CLIENTEDGE but nothing works: it keeps coming with that ugly sunken border. Has anyone a clue, or better, an example in C or C++? PS. of cource ES_MULTILINE,ES_AUTOHSCROLL,ES_AUTOVSCROLL are on... Thanks in advance... Rozis [Update] I found out i was still using version 1. Did some changes to support version 3 and 4.1. Because the control displays correctly (apart from that ugly border) I conclude this code must be ok. WS_EX_CLIENTEDGE ultimatly leads to SetWindowLong(). So I thought to be smart and set everything off, like this: SetWindowLong(whnd,GWL_EXSTYLE,0) To my surprise it still displays the border! What i want to get rid off is WS_BORDER, WS_EX_CLIENTEDGE and WS_EX_STATICEDGE. For version 4.1 I use Loadlibrary("MSFTEDIT.DLL") and classname "RichEdit50W". The MS-documentation says not all styles are implemented, so i thought maybe it is not possible. Your reactions indicate i'm not right... But i still can get it to work. Someone any (win32) suggestions? [Solved] Used Spy+ to find out wich styles where there. Used Setwindowlong() to put the styles in. I think this was a quirk of my gui-classes Thanks anyway [End Update]
modified on Friday, July 2, 2010 4:15 PM
-
I'm trying to create a RichEdit without any borders tried to set off ES_SUNKEN, WS_EX_CLIENTEDGE but nothing works: it keeps coming with that ugly sunken border. Has anyone a clue, or better, an example in C or C++? PS. of cource ES_MULTILINE,ES_AUTOHSCROLL,ES_AUTOVSCROLL are on... Thanks in advance... Rozis [Update] I found out i was still using version 1. Did some changes to support version 3 and 4.1. Because the control displays correctly (apart from that ugly border) I conclude this code must be ok. WS_EX_CLIENTEDGE ultimatly leads to SetWindowLong(). So I thought to be smart and set everything off, like this: SetWindowLong(whnd,GWL_EXSTYLE,0) To my surprise it still displays the border! What i want to get rid off is WS_BORDER, WS_EX_CLIENTEDGE and WS_EX_STATICEDGE. For version 4.1 I use Loadlibrary("MSFTEDIT.DLL") and classname "RichEdit50W". The MS-documentation says not all styles are implemented, so i thought maybe it is not possible. Your reactions indicate i'm not right... But i still can get it to work. Someone any (win32) suggestions? [Solved] Used Spy+ to find out wich styles where there. Used Setwindowlong() to put the styles in. I think this was a quirk of my gui-classes Thanks anyway [End Update]
modified on Friday, July 2, 2010 4:15 PM
This works ok over here
...
AfxInitRichEdit2();
...
DWORD dwStyle = ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_TABSTOP | WS_VISIBLE;CRect rc(200, 200, 600, 600);
//CRichEditCtrl wndRichEdit;
wndRichEdit.Create(dwStyle, rc, pWndParent, 30000);If you create the control in the resource editor, all you have to do is set
Border
to false -
I'm trying to create a RichEdit without any borders tried to set off ES_SUNKEN, WS_EX_CLIENTEDGE but nothing works: it keeps coming with that ugly sunken border. Has anyone a clue, or better, an example in C or C++? PS. of cource ES_MULTILINE,ES_AUTOHSCROLL,ES_AUTOVSCROLL are on... Thanks in advance... Rozis [Update] I found out i was still using version 1. Did some changes to support version 3 and 4.1. Because the control displays correctly (apart from that ugly border) I conclude this code must be ok. WS_EX_CLIENTEDGE ultimatly leads to SetWindowLong(). So I thought to be smart and set everything off, like this: SetWindowLong(whnd,GWL_EXSTYLE,0) To my surprise it still displays the border! What i want to get rid off is WS_BORDER, WS_EX_CLIENTEDGE and WS_EX_STATICEDGE. For version 4.1 I use Loadlibrary("MSFTEDIT.DLL") and classname "RichEdit50W". The MS-documentation says not all styles are implemented, so i thought maybe it is not possible. Your reactions indicate i'm not right... But i still can get it to work. Someone any (win32) suggestions? [Solved] Used Spy+ to find out wich styles where there. Used Setwindowlong() to put the styles in. I think this was a quirk of my gui-classes Thanks anyway [End Update]
modified on Friday, July 2, 2010 4:15 PM
Look there http://msdn.microsoft.com/en-us/library/bb787873(VS.85).aspx I guess that your form style like win98. To turn on XP or later versions style, include this code:
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\""
#endif -
Look there http://msdn.microsoft.com/en-us/library/bb787873(VS.85).aspx I guess that your form style like win98. To turn on XP or later versions style, include this code:
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\""
#endif -
This works ok over here
...
AfxInitRichEdit2();
...
DWORD dwStyle = ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_TABSTOP | WS_VISIBLE;CRect rc(200, 200, 600, 600);
//CRichEditCtrl wndRichEdit;
wndRichEdit.Create(dwStyle, rc, pWndParent, 30000);If you create the control in the resource editor, all you have to do is set
Border
to false