Quote:
quote:Originally posted by arvivair
Friends i have a problem in VB6
say if i design a software with a screen resolution of 800 X 600
and pack it for installation, but if i install it in a computer with screen resolution of 1024 X 768, the i have a problem. the position of the components doesn't adjust itself , but moves towards the north-western side,
how should i do it either with the code or with the attributes.
thanks in advance,
Arvind
|
Aravind
paste this function in bas module ..
Public Sub CenterForm(ByRef frm As Form)
Dim lTop As Long
Dim lLeft As Long
lTop = ((Screen.Height - frm.Height) / 2)
If (lTop < 0) Then
lTop = 0
End If
lLeft = ((Screen.Width - frm.Width) / 2)
If (lLeft < 0) Then
lLeft = 0
End If
frm.Move lLeft, lTop
End Sub
and call this function in all ur form_load events
Private Sub Form_Load()
CenterForm Me
.
.
.
.
end sub
try dis
Regards
Sush