Nuevo Foro de programacion
0 Usuarios y 1 Visitante están viendo este tema.
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As LongPrivate Declare Sub 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)Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As LongPrivate Type RECT Left As Long Top As Long Right As Long Bottom As LongEnd TypePrivate Sub MDIForm_Load() SetParent Command1.hwnd, Me.hwndEnd SubPrivate Sub MDIForm_Resize() Dim tWndPos As RECT GetWindowRect Me.hwnd, tWndPos SetWindowPos Command1.hwnd, 0, _ (tWndPos.Right - tWndPos.Left - Command1.Width / 15) / 2, _ (tWndPos.Bottom - tWndPos.Top - Command1.Height / 15) / 2, _ 0, 0, 1End Sub