Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado 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)
-
SI! que la imagen este cargada en la propiedad picture de un form si barra de titulo y alli colocas el boton!
-
Si pero no me sirve ahi amigo por el picture ocupa un lugar y no quiero que ocupe espacio
-
Hace lo siguiente:
- Agrega un Picture, y agregale un CommandButton (nombre: Command1) adentro
- Ponele AL PICTURE la propiedad Visible = False
- Adaptá el siguiente codigo para tus necesidades:
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
-
Bien ahi coco, un espectaculo
Gracias amigo.