CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2005
    Posts
    53

    Unhappy Notification about paint event

    I have a requirement where in I need to draw status images in the client area of a control [derived from AxHost].

    There is no means to know when this control gets painted because the OnPaint event of AxHost is not exposed/ supported.

    If I use a timer and keep painting the status images over the control, flicker occurs. Hence I want to avoid this method.

    Is there a way to hook this control and get notified whenever the control is painted ?

  2. #2
    Join Date
    Jan 2010
    Posts
    1,133

    Re: Notification about paint event

    You should be able to override the OnPaint(PaintEventArgs) method.

    MSDN on Aximp.exe:
    "The ActiveX Control Importer generates a class that is derived from the AxHost class, and compiles it into a library file (DLL) that can be added as a reference to your application. Alternatively, you can use the /source switch with the ActiveX Control Importer and a C# file is generated for your AxHost derived class. You can then make changes to the code and recompile it into a library file."

    So, you can use the /source switch to get the source code you can alter;
    or you can derive from that class (if it's not sealed), and then override.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured