Solved

Position Picture on MDI

Posted on 2008-10-12
2
209 Views
Last Modified: 2013-12-26
Hi,

I have a Picturebox sitting to the right side of an MDI. Another Picturebox sits on it. I need the 2nd picturebox to reposition to the bottom right corner of the MDI depending on screen size. Can someone help with some code, please.

Thanks.
0
Comment
Question by:tvtech
2 Comments
 
LVL 22

Accepted Solution

by:
danaseaman earned 250 total points
ID: 22699690
Code to align Picture2 bottom right within Picture1.

Option Explicit
 
Private Sub MDIForm_Resize()
   Dim Wi As Long
   Dim He As Long
   
   With Picture1
      Wi = .ScaleX(.ScaleWidth, .ScaleMode, vbTwips)
      He = .ScaleY(.ScaleHeight, .ScaleMode, vbTwips)
      Picture2.Move Wi - Picture2.Width, He - Picture2.Height
   End With
 
End Sub

Open in new window

0
 

Author Closing Comment

by:tvtech
ID: 31505526
danaseaman, perefect! Thank you.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question