Results 1 to 6 of 6

Thread: paint event mdi container

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    paint event mdi container

    Hey,

    Is it allowed to draw some custom text on a mdi container form in the paint event?
    I tried to drawstring as an example but it does not show up.

    Thanks,
    Don't anthropomorphize computers -- they hate it

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: paint event mdi container

    There's a link in my signature that shows you how to access the MDI parent background.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: paint event mdi container

    I love this place, the replies are always quick.
    Thank You,
    Don't anthropomorphize computers -- they hate it

  4. #4

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: paint event mdi container

    hmmm, it works fine if I set the backcolor.
    This however, does not work.

    [vbcode]
    For Each ctl As Control In Me.Controls
    If TypeOf ctl Is MdiClient Then
    Dim g As Graphics = ctl.CreateGraphics
    g.DrawRectangle(Pens.AntiqueWhite, New Rectangle(200, 200, 500, 500))
    End If
    Next
    [/vbcode]
    Don't anthropomorphize computers -- they hate it

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: paint event mdi container

    As for all controls, you have to draw on the MdiClient's Paint event or your drawing will simply be erased next time the control is repainted.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: paint event mdi container

    agh, makes sense. forgot, thanks.
    Don't anthropomorphize computers -- they hate it

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