M
Matt
I've been searching around for a simple way to display a background
image in my MDI form's client area.
I want to be able to load the image from file on start up
and have it resize as the MDI form is resized.
It's the resizing part that I am having trouble with.
I've seen a few old posts that point in the right direction but
nothing simple.
I wondered if they has been any new ideas I have missed.
Working with an MDI child form is easy and the following code works a
treat.
Public Class Form2
Inherits System.Windows.Forms.Form
Private newImage As Image =
Image.FromFile("D:\Pics\Background.bmp")
Private Sub Form2_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
' Create a rectangle the size of the child form.
Dim destRect As New Rectangle(1, 1, Me.ClientSize.Width,
Me.ClientSize.Height)
' Draw image to screen.
e.Graphics.DrawImage(newImage, destRect)
End Sub
End Class
Is there anything as simple for the MDI form?
Failing that, anything at all that works?
Thank you in advance.
Matt
image in my MDI form's client area.
I want to be able to load the image from file on start up
and have it resize as the MDI form is resized.
It's the resizing part that I am having trouble with.
I've seen a few old posts that point in the right direction but
nothing simple.
I wondered if they has been any new ideas I have missed.
Working with an MDI child form is easy and the following code works a
treat.
Public Class Form2
Inherits System.Windows.Forms.Form
Private newImage As Image =
Image.FromFile("D:\Pics\Background.bmp")
Private Sub Form2_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
' Create a rectangle the size of the child form.
Dim destRect As New Rectangle(1, 1, Me.ClientSize.Width,
Me.ClientSize.Height)
' Draw image to screen.
e.Graphics.DrawImage(newImage, destRect)
End Sub
End Class
Is there anything as simple for the MDI form?
Failing that, anything at all that works?
Thank you in advance.
Matt