Centrere
Hej der - der er points hvis der er en der kan komme med en nemmere og enklere løsning end den jeg har her.......'Function declaretion for set window position
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
'Constants for window position
Const conHwndTopmost = -1
Const conHwndNoTopmost = -2
Const conSwpNoActivate = &H10
Const conSwpShowWindow = &H40
'Actions preformed when the form i loaded
Private Sub Form_Load()
'Sets variables for windowposition on screen
'Using SysInfo to get resolution and screen size
varX1 = ((SysInfo1.WorkAreaWidth / 15) / 2) - 200
varY1 = ((SysInfo1.WorkAreaHeight / 15) / 2) - 150
varX2 = 400
varY2 = 300
'Sets window position
SetWindowPos hwnd, conHwndTopmost, varX1, varY1, varX2, varY2, _
conSwpNoActivate Or conSwpShowWindow
/Tubber
