Click here to Skip to main content
15,946,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In a dilag, the edit control has a border default, I want to remove its border, there is no ways except by setting in the property board, so I want to remove it at runtimes, how to do?


Thanks!
Posted

C#
m_wndEdit.ModifyStyleEx(WS_EX_CLIENTEDGE, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED);
 
Share this answer
 
MSDN is your friend. Install it if you don't already have it. Search it before jumping to post a question on the net.

Any UI elements you add from the property board is present, as code, in the .rc file. Open that in the notepad (visual studio doesn't display the textual version) and analyse.

I'll answer your question this time and remember what I said for the future.

Get the existing style using GetWindowStyle(...). Remove WS_BORDER flag from it and set it back using SetWindowStyle(...).
 
Share this answer
 
Any setting in properties, can be set in code, in fact, it probably IS set in code that's generated by the IDE. So, I would suggest looking at the auto generated code and seeing what it does, an easy way to do this is to copy your project, change that one thing in the IDE, then diff the two projects and find what line of code is different.
 
Share this answer
 
http://msdn.microsoft.com/en-US/library/f7yhsd2b(v=VS.80).aspx[^]

You can find all the member function and properties here..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900