|
-
Jun 13th, 2000, 01:03 PM
#1
Thread Starter
Addicted Member
I heard of a magical ocx that
resizes every form to fit the
screen .. like directx or
something like that.
Could someone give me that
ocx?
-
Jun 13th, 2000, 01:21 PM
#2
New Member
VideoSoft - VSVBX is the best one. Isn't cheap but worth the purchase.
Dennis
-
Jun 14th, 2000, 03:30 AM
#3
Another way of doing it is to set the Form to the scrrent Screen's Height and Width. This is done by using the Screen object.
Code:
Private Sub Form_Resize()
Me.Left = 0
Me.Top = 0
Me.Height = Screen.Height
Me.Width = Screen.Width
End Sub
Another way is to set the Form's WindowState to maximized.
-
Jun 14th, 2000, 05:27 AM
#4
Thread Starter
Addicted Member
You dont understand.
I need a way to resize the pictures,
Text boxes.. EVERYTHING.
Not just the form.
-
Jun 14th, 2000, 05:42 AM
#5
Use a For Each loop and resize everything to fit the screen.
Code:
Dim MyObj As Object
For Each MyObj In Controls
MyObj.Move 0, 0
MyObj.Width = Screen.Width
MyObj.Height = Screen.Height
Next MyObj
-
Jun 14th, 2000, 06:35 AM
#6
Fanatic Member
'-->module routines
Option Explicit
Private Type ControlsSizes
csTop As Single
csLeft As Single
csWidth As Single
csHeight As Single
End Type
Private AllControls() As ControlsSizes
'-->form rotuines
Private Sub Form_Initialize()
Dim counta As Integer
ReDim Preserve AllControls(Controls.Count - 1)
For counta = 0 To Controls.Count - 1
With AllControls(counta)
.csTop = Controls(counta).Top / ScaleHeight
.csLeft = Controls(counta).Left / ScaleWidth
.csWidth = Controls(counta).Width / ScaleWidth
.csHeight = Controls(counta).Height / ScaleHeight
End With
Next
End Sub
Private Sub Do_Resize()
Dim counta As Integer
For counta = 0 To Controls.Count - 1
With AllControls(counta)
Controls(counta).Move .csLeft * ScaleWidth, .csTop * ScaleHeight, .csWidth * ScaleWidth, .csHeight * ScaleHeight
End With
Next
End Sub
Private Sub Form_Resize()
Do_Resize
End Sub
-
Jun 14th, 2000, 06:54 AM
#7
_______
Here it is...
' #VBIDEUtils#************************************************************
' * Programmer Name : Mikhail Shmukler
' * Web Site : http://www.geocities.com/ResearchTriangle/6311/
' * E-Mail : [email protected]
' * Date : 13/10/98
' * Time : 10:24
' * Module Name : class_Elastic
' * Module Filename : Elastic.cls
' **********************************************************************
' * Comments :
' * This class can change size and location of controls On your form
' * 1. Resize form
' * 2. Change screen resolution
' * Assumes:1. Add Elastic.cls
' * 2. Add declaration 'Private El as New class_Elastic'
' * 3. Insert string like 'El.init Me' (formload event)
' * 4. Insert string like 'El.FormResize Me' (Resize event)
' * 5. Press 'F5' and resize form ....
'
'****************************************************************
Option Explicit
Private nFormHeight As Integer
Private nFormWidth As Integer
Private nNumOfControls As Integer
Private nTop() As Integer
Private nLeft() As Integer
Private nHeight() As Integer
Private nWidth() As Integer
Private nFontSize() As Integer
Private nRightMargin() As Integer
Private bFirstTime As Boolean
Sub Init(frm As Form, Optional nWindState As Variant)
Dim I As Integer
Dim bWinMax As Boolean
bWinMax = Not IsMissing(nWindState)
nFormHeight = frm.Height
nFormWidth = frm.Width
nNumOfControls = frm.Controls.Count - 1
bFirstTime = True
ReDim nTop(nNumOfControls)
ReDim nLeft(nNumOfControls)
ReDim nHeight(nNumOfControls)
ReDim nWidth(nNumOfControls)
ReDim nFontSize(nNumOfControls)
ReDim nRightMargin(nNumOfControls)
On Error Resume Next
For I = 0 To nNumOfControls
If TypeOf frm.Controls(I) Is Line Then
nTop(I) = frm.Controls(I).Y1
nLeft(I) = frm.Controls(I).X1
nHeight(I) = frm.Controls(I).Y2
nWidth(I) = frm.Controls(I).X2
Else
nTop(I) = frm.Controls(I).Top
nLeft(I) = frm.Controls(I).Left
nHeight(I) = frm.Controls(I).Height
nWidth(I) = frm.Controls(I).Width
nFontSize(I) = frm.FontSize
nRightMargin(I) = frm.Controls(I).RightMargin
End If
Next
If bWinMax Or frm.WindowState = 2 Then ' maxim
frm.Height = Screen.Height
frm.Width = Screen.Width
Else
frm.Height = frm.Height * Screen.Height / 7290
frm.Width = frm.Width * Screen.Width / 9690
End If
bFirstTime = True
End Sub
Sub FormResize(frm As Form)
Dim I As Integer
Dim nCaptionSize As Integer
Dim dRatioX As Double
Dim dRatioY As Double
Dim nSaveRedraw As Long
On Error Resume Next
nSaveRedraw = frm.AutoRedraw
frm.AutoRedraw = True
If bFirstTime Then
bFirstTime = False
Exit Sub
End If
If frm.Height < nFormHeight / 2 Then frm.Height = nFormHeight / 2
If frm.Width < nFormWidth / 2 Then frm.Width = nFormWidth / 2
nCaptionSize = 400
dRatioY = 1# * (nFormHeight - nCaptionSize) / (frm.Height - nCaptionSize)
dRatioX = 1# * nFormWidth / frm.Width
On Error Resume Next ' for comboboxes, timeres and other nonsizible controls
For I = 0 To nNumOfControls
If TypeOf frm.Controls(I) Is Line Then
frm.Controls(I).Y1 = Int(nTop(I) / dRatioY)
frm.Controls(I).X1 = Int(nLeft(I) / dRatioX)
frm.Controls(I).Y2 = Int(nHeight(I) / dRatioY)
frm.Controls(I).X2 = Int(nWidth(I) / dRatioX)
Else
frm.Controls(I).Top = Int(nTop(I) / dRatioY)
frm.Controls(I).Left = Int(nLeft(I) / dRatioX)
frm.Controls(I).Height = Int(nHeight(I) / dRatioY)
frm.Controls(I).Width = Int(nWidth(I) / dRatioX)
frm.Controls(I).FontSize = Int(nFontSize(I) / dRatioX) + Int(nFontSize(I) / dRatioX) Mod 2
frm.Controls(I).RightMargin = Int(nRightMargin(I) / dRatioY)
End If
Next
frm.AutoRedraw = nSaveRedraw
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 14th, 2000, 01:06 PM
#8
Fanatic Member
I didn't think this is what Dayo312 meant (I could be wrong)
Dayo312 mentioned DirectX resizing so I got the impression that he meant change the screen rez to match the form (thus making the form "bigger")
Like when you have a DirectX game which actually runs in 640x480 and your screen is running at 1024x768, the screen goes black, resizes then displays the 640x480 game full screen. Where the actualy size of everything increases but the co-ord positions stay the same. Pixel size is what changes
Or I'm miss reading the question... in which case please ignore me
Oh, BTW, I have no idea how to do it 
Paul
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|