Re: Distorted dialog title bar after SetWindowPos in OnInitDialog



If you also want to keep Z-order, you'll need another SetWindowPos.

"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:5jhbn2t55j2lnnr50uq87m8eeqftdiprul@xxxxxxxxxx
That ;is exactly one of the problems I've seen; and Default() really does
pass the
WM_SETTEXT to the base class, which gets the drawing wrong. It also can
produce annoying
flicker as the wrong text is displayed, the area is invalidated, and the
right text is
displayed.

There's a cheat I do, when I'm feeling lazy. I place a CStatic down and
use it as a
frame. Then I

c_Frame.GetWindowRect(&r);
ScreenToClient(&r);
c_MyControl.Create(...., r, c_Frame.GetDlgCtrlID(), this);
c_Frame.DestroyWindow();

it adds just a few lines to the OnInitDialog, lets me place the control
easily, and just
replaces it at runtime by a control of the same size and ID, but derived
from my desired
class. Much easier than having to define new window classes so I can name
them and then
figure out the hex values for the style bits.
joe



.



Relevant Pages

  • Re: Why must I paint the form background for an owner-draw control?
    ... His problem stems from the fact that the button base Class has ... This problem does not appear in a class based upon Control ... that is why there is a black background. ... >> protected override void OnMouseDown ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: How to prevent base class (UserControl) form being serialized
    ... the base class so your control won't have a name, know its visibility, know ... My object happens to be derived from a control so I am penalizes for that. ... them on the code for the UserControl. ... Just serialize this structure ...
    (microsoft.public.dotnet.general)
  • Re: Controling Event Sequencing...
    ... need the OnPostClick event fire after the OnClick event is completely ... event queue and have it execute AFTER the OnClick in completely done ... ... control exposes this event to the programmer to allow him / her to ... So, what I want to be able to do, is create a base class object for this ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How do I have two user controls with one code-behind file?
    ... For the reference: http://msdn2.microsoft.com/en-us/library/d19c0t4b.aspx ... CodeFileBaseClass ... Specifies a path to a base class for a control and its associated ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: anchor property for button not working
    ... >>base form's design page, the control doesn't show up at run time on the ... > of base class whether to show at run time on the inherited form or not. ...
    (microsoft.public.dotnet.framework.windowsforms)