16. marts 2000 - 10:59
Der er
3 kommentarer og
1 løsning
form height
Jeg ønsker at bruge en form som layout til et print. Men der er en max height (afhængig af skærmstørrelse) Er der nogen måde hvor på man kan få størrelsen på formen til en A4 side,uafhængig af skærmopløsningen ????
26. marts 2000 - 20:41
#4
This example was in a recent VB publication. This creates a Vertical and
Horizontal scrollable window.
Place a picture box control on the form and size it to fill a good portion
of the form. Next, place a vertical scrollbar beside the picture box, make
it the same height as the picture box, and align the tops of the controls.
Also, place a horizontal scrollbar and size it accordingly.
Now, draw another picture box within the first picture box. You can't
simply double click on the toolbox - You need to *manually* draw this
control. Doing so will make Picture1 the *container* for Picture2. Set
Picture2's Appearance property to Flat, then set its Top, Left, Height, and
Width properties to the same values as Picture1.
Next, set Picture2's Autosize property to True. Doing so allows it to
assume the size of the assigned bitmap image. Finally, assign a bitmap
(large; to overrun the side of the control) to Picture2's picture property.
Option Explicit
Private lFromRight As Long
Private lFromBottom As Long
Private Sub Form_Load()
VScroll1.Max = Picture2.Height - Picture1.Height
VScroll1.LargeChange = VScroll1.Max / 5
VScroll1.SmallChange = VScroll1.Max / 25
VScroll1.Height = Picture1.Height
HScroll1.Max = Picture2.Width - Picture1.Width
HScroll1.LargeChange = HScroll1.Max / 5
HScroll1.SmallChange = HScroll1.Max / 25
HScroll1.Width = Picture1.Width
lFromRight = Me.ScaleWidth - Picture1.Width - Picture1.Left
lFromBottom = Me.ScaleWidth - Picture1.Height - Picture1.Top
VScroll1.Height = Picture1.Height
HScroll1.Width = Picture1.Width
End Sub
Private Sub HScroll1_Change()
Picture2.Left = -HScroll1.Value
End Sub
Private Sub VScroll1_Change()
Picture2.Top = -VScroll1.Value
End Sub
Det er et eksempel jeg engang har fundet selv til samme formål.
Håber du kan bruge det...