Results 1 to 2 of 2

Thread: Changing the Background of an MDI Parent Form

Threaded View

  1. #2

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Changing the Background of an MDI Parent Form

    Here's some more succinct code that uses extension methods and, therefore, requires .NET 3.5 or later:
    CSharp Code:
    1. private void Form1_Load(object sender, EventArgs e)
    2. {
    3.     // Get a reference to the one and only MdiClient in the Controls collection.
    4.     MdiClient client = this.Controls.OfType<MdiClient>().Single();
    5.  
    6.     // Set properties of the MdiClient here, e.g.
    7.     client.BackgroundImage = Properties.Resources.MdiBackgroundImage;
    8. }
    Last edited by jmcilhinney; Mar 15th, 2019 at 08:59 PM.
    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

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