Results 1 to 11 of 11

Thread: [RESOLVED] Invalidating Inherited Controls When Parent Form Is Resized Or Moved

Threaded View

  1. #1

    Thread Starter
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Resolved [RESOLVED] Invalidating Inherited Controls When Parent Form Is Resized Or Moved

    Pretending I have a class that inherits off Control, how would I handle the parent form's Resize and Move events within the control? I have a painting glitch that happens when the form is resized or moved. Right now in the form I just have:

    vb.net Code:
    1. Private Sub frmMain_ResizeMove(ByVal sender As Object, ByVal e As System.EventArgs) _
    2. Handles Me.Resize, Me.Move
    3.     Me.Refresh()
    4. End Sub

    But this can't be the proper way to do it, considering Refresh() invalidates all children (will be slow and flashing if the form has lots of controls). I want to basically do the above code inside the control.

    Edit:

    This is the glitch after a resize of the parent form:

    And this is what the button is supposed to look like:


    Also, I experience this issue if something like a message box is dragged over top of it. How can I remedy these issues by forcing a repaint?
    Last edited by ForumAccount; Jul 19th, 2009 at 02:53 AM.

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