Solved

Changing Window Styles After Creation

Posted on 1998-02-11
3
303 Views
Last Modified: 2006-11-17
 Is there an easy way to change the style of a window after it's created?  I've tried to change a TEdit control from ES_LEFT to ES_CENTER using SetStyle() (Borland C++) and SetWindowLong(GWL_STYLE) both with ES_CENTER or'd in.  Neither one changed it.  I tried the same two functions when attempting to remove the WS_HSCROLL from a window.  Again, no change.
0
Comment
Question by:twiley
3 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1181845
To change this style use SetWindowLong with GWL_EXSTYLE.
0
 

Author Comment

by:twiley
ID: 1181846
GWL_EXSTYLE doesn't have any effect on WS_HSCROLL or ES_xxxx.
0
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1181847
You need to redraw the window by calling
SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question