how display picture on MDI form
please help
i have a MDI form and i display a picture on that if i put a picture box on form and set imge or backgroundimage porprety of picture box then picture box show picture at design time but when i run project no picture show on MDI form. how can i display picture on MDI form at run time
Re: how display picture on MDI form
Have you included the picture in you're project ?
Re: how display picture on MDI form
first of all welcome to the forums ??
second thing, you should never double post on the forum, only post bump in the same thread and it will just up again.
third thing : regarding your problem, ;)
when you set any form to be a mdi parent form, in run time it creates an object like a desktop that will host the child forms. (that is why when you run the project after setting the mdiparent form itself with a picture, the picture flashes out and then get covered by a gray layer).
when drawing or assigning pictures to mdi parent form,u should assign the picture or the drawing to the mdi desktop layer and not the form it self , how to do this ? check the vb code below, make sure to put it inside the mdi parent form
VB Code:
'on the form level declare a variable to hold the mdi desktop object
Private WithEvents MDLCTL As New MdiClient
'on the form load event, you need to hook up with the mdi client object ,
'hooking up with the mdiclient of the parent ro draw anything
For Each Ctl as control In Me.Controls
If TypeOf Ctl Is MdiClient Then
MDLCTL = Ctl
Exit For
End If
Next
Ctl = Nothing
'now you can assign pictures or drawing to mdlctl object to see it on form
by overriding the paint event for the mdlctl you defined and loaded in the start
this is the theory, adjust it to your needs
rgds
Re: how display picture on MDI form
I had done an example for someone about a month or so ago..
http://www.vbforums.com/showthread.p...ight=image+mdi