Hi everyone, is there a possible way in moving the position of a picturebox anywhere inside an MDI form?


I tried to use the picturebox's left and top property through code but when the mdi form is loaded, the picture box is still aligned at the top, or at the left...(during the design time, VB doesn't allow in setting the align property of the picturebox to Align-None)

Though I haven't tried using any API, because i don't know what API should I use...any suggestions, or advise?

sample codes would be useful...

thank you very much..:)

Hi everyone, is there a possible way in moving the position of a picturebox anywhere inside an MDI form? [ATTACH]16691[/ATTACH]

I tried to use the picturebox's left and top property through code but when the mdi form is loaded, the picture box is still aligned at the top, or at the left...(during the design time, VB doesn't allow in setting the align property of the picturebox to Align-None)

Though I haven't tried using any API, because i don't know what API should I use...any suggestions, or advise?

sample codes would be useful...

thank you very much..:)

You may have just one picture inside the MDIForm. Under properties select a Bitmap picture. Try to write for eg. the Picture1.Left = 500 and Picture1.Top = 1000 inside the MDIForm Load and see... But, I doubt it'll work. The only way is just to fixing 1 picture throughout the MDIForm as I mentioned firstly.

commented: thank you for your quick response... +2

@Aslam Mansoor: You have an idea...but placing picture box all over the mdi form might cover up my mdichild forms and thus, not allowing my mdichild forms to show up...(that's vb's default behavior regarding the picture box and the mdi child forms)

But anyway....thank you for your response....I greatly appreciate it...:D

As you have found out, since the PB is a container control, you can have the PB anchored to any side of the MDIParent form but it cannot be free floating. However, you can make it look like it is free floating by using a MDI child with no caption and no toolbox with a borderstyle of none. Then you could size your PB to the size of the form...

Good Luck

commented: Tnank you for your help! +2

@vb5prgrmr: Hey! Great idea!, I haven't try that....Now I can continue in creating a floating toolbox in my MDIForm! Thank you! :)

@Aslam Mansoor: You have an idea...but placing picture box all over the mdi form might cover up my mdichild forms and thus, not allowing my mdichild forms to show up...(that's vb's default behavior regarding the picture box and the mdi child forms)

But anyway....thank you for your response....I greatly appreciate it...:D

Dear Poisoned Heart
Open the MDIForm1 and under Properties you'll find Picture, there select a piture you like. And under Properties WindowState = Maximized. Here you'll get the picture all over the MDIForm.

Don't worry, your child forms will not be covered by the picture of the MDIForm.
Try and seeeeeeeeee. It should work...

Aslam

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.