|
-
Apr 20th, 2006, 08:37 AM
#1
Thread Starter
New Member
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
-
Apr 20th, 2006, 08:46 AM
#2
Fanatic Member
Re: how display picture on MDI form
Have you included the picture in you're project ?
-
Apr 20th, 2006, 09:31 AM
#3
Frenzied Member
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
-
Apr 20th, 2006, 10:09 AM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|