Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arangement problems 1

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
Trying to get two buttons, to stay down in lower right corner during resize, however the code below seems to make the top of the buttons right at the edge of the form (10 for some margin)<br>also going to need to get a Picture box from top of the form, to right above the buttons, but left of the file1 box.<br><br>With BtnOK<br>&nbsp;&nbsp;&nbsp;.Top = Me.Height - (.Height + 10)<br>&nbsp;&nbsp;&nbsp;.Left = Me.Width - (.Width + 10)<br>End With<br><br>With BtnCancel<br>&nbsp;&nbsp;&nbsp;.Top = BtnOK.Top<br>&nbsp;&nbsp;&nbsp;.Left = (BtnOK.Left - .Width) - 10<br>End With<br><br>Picture1.Move (File1.Width + File1.Left + 5), 0, (Me.Width - (File1.Width + File1.Left + 5)), (Me.Height - (Me.Height - BtnOK.Top))<br> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Try this:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;With btnOK<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Top = Me.Height - (.Height + 420)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Left = Me.Width - (.Width + 120)<br>&nbsp;&nbsp;&nbsp;&nbsp;End With<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;With btnCancel<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Top = btnOK.Top<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Left = (btnOK.Left - .Width) - 10<br>&nbsp;&nbsp;&nbsp;&nbsp;End With<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Picture1.Move (File1.Width + File1.Left + 5), 0, (Me.Width - (File1.Width + File1.Left + 5)), (Me.Height - (Me.Height - btnOK.Top + 100))<br> <p>Steve Meier<br><a href=mailto:tribesaddict@swbell.net>tribesaddict@swbell.net</a><br><a href= > </a><br>
 
Karl,<br>&nbsp;&nbsp;&nbsp;&nbsp;Use me.ScaleHeight and me.ScaleWidth.&nbsp;&nbsp;This will give you the inner dimensions of the form.&nbsp;&nbsp;Using height and width includes the banner, border, scroll bars, etc. which you don't want. <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
Using NickBulka's of scale height and width, I've come up with these subroutines(to keep from typing it twice) which work perfectly here are the subs<br><br><b> For adjusting Scrollbars inside Picture1 </b><br><FONT FACE=monospace><br>Private Sub UpdateScroll()<br>&nbsp;&nbsp;&nbsp;With HScroll1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Top = Picture1.ScaleHeight - .Height<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Left = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Width = Picture1.ScaleWidth - VScroll1.Width<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Max = Picture2.ScaleWidth - Picture1.ScaleWidth<br>&nbsp;&nbsp;&nbsp;End With<br><br>&nbsp;&nbsp;&nbsp;With VScroll1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Top = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Left = Picture1.ScaleWidth - .Width<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Height = Picture1.ScaleHeight - HScroll1.Height<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Max = Picture2.ScaleHeight - Picture1.ScaleHeight<br>&nbsp;&nbsp;&nbsp;End With<br><br>&nbsp;&nbsp;&nbsp;HScroll1.Max = Picture2.Width - Picture1.Width<br>&nbsp;&nbsp;&nbsp;VScroll1.Max = Picture2.Height - Picture1.Height<br><br>&nbsp;&nbsp;&nbsp;VScroll1.Visible = (Picture1.Height &lt; Picture2.Height)<br>&nbsp;&nbsp;&nbsp;HScroll1.Visible = (Picture1.Width &lt; Picture2.Width)<br>End Sub<br></font><br><b>for adjusting the position of the Picture1 box and Buttons</b><br><FONT FACE=monospace><br>Private Sub UpdatePosition()<br>If Me.ScaleWidth &gt; (Dir1.Width + File1.Width + BtnOK.Width + BtnCancel.Width) And Me.ScaleHeight &gt; (File1.Height) Then<br>&nbsp;&nbsp;&nbsp;With BtnOK<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Top = Me.ScaleHeight - .Height<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Left = Me.ScaleWidth - .Width<br>&nbsp;&nbsp;&nbsp;End With<br><br>&nbsp;&nbsp;&nbsp;With BtnCancel<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Top = BtnOK.Top<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Left = (BtnOK.Left - .Width)<br>&nbsp;&nbsp;&nbsp;End With<br><br>&nbsp;&nbsp;&nbsp;Picture1.Move (File1.Width + File1.Left), 0, (Me.ScaleWidth - (File1.Width + File1.Left)), (Me.ScaleHeight - (Me.ScaleHeight - BtnOK.Top))<br><br>&nbsp;&nbsp;&nbsp;Picture2.Move 0, 0<br>&nbsp;&nbsp;&nbsp;UpdateScroll<br><br>Else<br>&nbsp;&nbsp;&nbsp;If Me.ScaleWidth &lt; (Dir1.Width + File1.Width + BtnOK.Width + BtnCancel.Width) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Me.Width = (Dir1.Width + File1.Width + BtnOK.Width + BtnCancel.Width)<br>&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;If Me.ScaleHeight &lt; (File1.Height) Then Me.Height = File1.Height + BtnOK.Height<br>End If<br>End Sub<br></font><br><br>thanks alot. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top