Why isn't this working? 
Author Message
 Why isn't this working?

I have this on a form,
Everything works except the .TOP
that never works, the form aligns to the left sid of the picture box
but never to the top
the top differs each time.

I want to align the Top of this form to the top of the picturebox

Private Sub Form_Resize()
    Me.Top = frmMain.picMDI.ScaleTop 'I tried .Top aswell
    Me.Left = frmMain.picMDI.ScaleLeft
    Me.Width = frmMain.picMDI.ScaleWidth
    Me.Height = frmMain.picMDI.ScaleHeight

End Sub

Thnx for anyhelp



Tue, 24 Aug 2004 05:37:00 GMT  
 Why isn't this working?
The coordinates you are using are relative to the picture box, or relative
to the top of the mdi form when you use the Top property. You want the
coordinates relative to the top of the screen, so you have to add them to
the top and left properties of the form the control is on like this:

Me.Top = frmMain.picMDI.Top + frmMain.Top
Me.Left = frmMain.picMDI.Left + frmMain.Left

Jason Bouzane

Quote:

> I have this on a form,
> Everything works except the .TOP
> that never works, the form aligns to the left sid of the picture box
> but never to the top
> the top differs each time.

> I want to align the Top of this form to the top of the picturebox

> Private Sub Form_Resize()
>     Me.Top = frmMain.picMDI.ScaleTop 'I tried .Top aswell
>     Me.Left = frmMain.picMDI.ScaleLeft
>     Me.Width = frmMain.picMDI.ScaleWidth
>     Me.Height = frmMain.picMDI.ScaleHeight

> End Sub

> Thnx for anyhelp



Tue, 24 Aug 2004 07:41:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Why isn't this working??

2. why isn't this working?

3. Why isn't this working

4. Why isn't this working?

5. Why isn't this working?

6. why isn't this working

7. Why isn't his working correctly...?

8. Why isn't this working!! Help!!!

9. Why isn't this working? - mailing with outlook

10. SHELL command within VB5. WHY ISN'T IT WORKING

11. Why isn't my code working?

12. Why isn't my filter working in the Common Dialog ShowOpen Function

 

 
Powered by phpBB® Forum Software