Tiling an Image on an MDI form

how do i tile an image on an mdi form. i can tile them on regular forms but mdi forms don't have the place picture property. how do i do it?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
You can put a PictureBox on the MDI form.
hessAuthor Commented:
then the child form won't have a place to be. I want to konw how to tile a picture across the bg of a MDI form
Bob LearnedCommented:
What version of VB?  I have VB6 and the MDIForm has a Picture property.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

hessAuthor Commented:
it doesn't have  a placepicture... i can put a picture on it but i need to know how to tile a small picture across it...vb 6
Bob LearnedCommented:
You are losing me, because my MDIForm has a Picture property, and you said that you know how to tile across a normal form.  

So what is the problem?
hessAuthor Commented:
but you can't tile on the mdi one cause to do it you need a place picture method on the form you want to do it on and the mdi form has no place picture property.
Éric MoreauSenior .Net ConsultantCommented:
You simply cannot tile a small bitmap on a MDI form.

Thera are at least 2 workarounds to this:
1 - My prefered one. Use a paint editor, tile your bitmap to cover an entire screen, save it and pur this new big bitmap in the Picture property of your MDI form. So there is no tiling just one big bitmap.

2 - But a child form in which you tile your bitmap and place code to be sure that the user won't close this form.
hessAuthor Commented:
is there a way to tile the bmp on in a picture box... then set that pictures picture to the mdi form's picture so taht the mdi gets a tiled image?
Bob LearnedCommented:
Tile the image on a regular form, and then transfer the picture image to the MDIForm Picture property.

Private Sub Background()
Dim i           As Long
Dim j           As Long

   With Form1
      .Width = Width
      .Height = Height
      With .picBkImage
         For i = 0 To Form1.ScaleWidth Step .Width
             For j = 0 To Form1.ScaleHeight Step .Height
                 Form1.PaintPicture .Picture, i, j, .Width, .Height + 30
             Next j
         Next i
      End With
    End With
    Picture = Form1.Image
End Sub

Private Sub MDIForm_Load()

End Sub
'MDIForm:The name of the MDI parent form to tile an image onto.
'bkgdtiler: The name of a form that is used to generate the tiled background. Check the rest of the docs for the -required- parameters.
'bkgdfile: The image file to load, With complete path.
'The best place to put the call I find is in the form's Form_Load() event.

Sub TileMDIBkgd(MDIForm As Form, bkgdtiler As Form, bkgdfile As String)

    If bkgdfile = "" Then Exit Sub
    Dim ScWidth%, ScHeight%
    ScWidth% = Screen.Width / Screen.TwipsPerPixelX
    ScHeight% = Screen.Height / Screen.TwipsPerPixelY
    Load bkgdtiler
    bkgdtiler.Height = Screen.Height
    bkgdtiler.Width = Screen.Width
    bkgdtiler.ScaleMode = 3
    bkgdtiler!Picture1.Top = 0
    bkgdtiler!Picture1.Left = 0
    bkgdtiler!Picture1.Picture = LoadPicture(bkgdfile)
    bkgdtiler!Picture1.ScaleMode = 3

    For n% = 0 To ScHeight% Step bkgdtiler!Picture1.ScaleHeight

        For o% = 0 To ScWidth% Step bkgdtiler!Picture1.ScaleWidth
            bkgdtiler.PaintPicture bkgdtiler!Picture1.Picture, o%, n%
        Next o%

    Next n%

    MDIForm.Picture = bkgdtiler.Image
    Unload bkgdtiler
End Sub


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.