Visual Basic Foro

Programación => Visual Basic 6 => Mensaje iniciado por: E N T E R en Julio 24, 2013, 06:24:50 pm

Título: Agregar un boton dentro del MDI
Publicado por: E N T E R en Julio 24, 2013, 06:24:50 pm
Tengo un MDI con un fondo de imagen, hay una menera de poner un boton sobre esa imagen

(http://www.mediafire.com/convkey/2594/11w252w29gvnsf24g.jpg) (http://www.mediafire.com/view/11w252w29gvnsf2/mdi-1.png)

ejemplo colocar un boton en donde esta el 64

(http://www.mediafire.com/convkey/eeda/9t1t7afmfc4m1da4g.jpg) (http://www.mediafire.com/view/9t1t7afmfc4m1da/mdi-2.png)

aca mi code
http://www.mediafire.com/?iy41e5t34zu4n04 (http://www.mediafire.com/?iy41e5t34zu4n04)
Título: Re:Agregar un boton dentro del MDI
Publicado por: Bazooka en Julio 24, 2013, 06:47:16 pm
SI! que la imagen este cargada en la propiedad picture de un form si barra de titulo y alli colocas el boton!
Título: Re:Agregar un boton dentro del MDI
Publicado por: E N T E R en Julio 24, 2013, 07:01:54 pm
Si pero no me sirve ahi amigo por el picture ocupa un lugar y no quiero que ocupe espacio
Título: Re:Agregar un boton dentro del MDI
Publicado por: coco en Julio 29, 2013, 01:47:14 am
Código: (VB) [Seleccionar]
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private 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 Long

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Sub MDIForm_Load()
    SetParent Command1.hwnd, Me.hwnd
End Sub

Private 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, 1
End Sub

Saludos
Título: Re:Agregar un boton dentro del MDI
Publicado por: E N T E R en Julio 29, 2013, 11:33:30 am
Bien ahi coco, un espectaculo

Gracias amigo.