Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Flicking TElEdit-Controls

The TElEdit-Controls are flickering very strong even in simple resizable forms.

See attached Test-project.
zip
zip
FlackerElEdit.zip
4K

Comments

  • 5 Comments sorted by Votes Date Added
  • Thanks for report, I'll look...
  • Hi,

    Flickering happens due to extensive panels redrawings, because of enabled transparency. I suggest you to turn off TransparentXPThemes property in each of TElPanel.
  • This helps to reduce flickering, but doesn't make it disappear.
    Even when setting DoubleBuffer = True, it flickers.

    And it flickers very strong in complex GUIs.

    I try to active VCL-Theming and Flickering disapear.
    But it crashes my real application on startup with activate of VCL-Theming :-(


  • We could reduce flickering (in our application) by adding following code

    procedure WMNCPaint(var Msg: TMessage); message WM_NCPAINT;

    procedure TCustomElEdit.WMNCPaint(var Msg: TMessage);
    var
      WS: DWORD;
    begin
      WS  := GetWindowLong(Handle, GWL_STYLE);
      if WS and WS_BORDER <> 0 then
      begin
        FPreventStyleChange := True;
        SetWindowLong(Handle, GWL_STYLE, WS and
    not WS_BORDER);
      end
    end;


  • Hi,

    Effectively what your code do, is prevents "inherited" from been called. So, this can be simplified to:

    procedure TCustomElEdit.WMNCPaint(var Msg: TMessage);
    begin
      // Do not call inherited.
    end;

    And it works, you right.
Sign In or Register to comment.