como hago para remover lo q marque en rojo? :P
http://img108.imageshack.us/img108/4727/untitled9rw.jpg
y agregar dos botones uno q minimize y otro q cierre?? :rolleyes:
desde ya muchas gracias..:)
En primer lugar, para "borrar" la barra de título de un formulario tienes que establecer la propiedad BorderStyle a None.
Esto solo se puede hacer en tiempo de diseño, en tiempo de ejecución no.
Si quieres quitar la barra de título en tiempo de ejecución tendrás que usar APIs. En el ejemplo de más abajo utilizaremos las API CreatewindowRegtRgn y Setwindowreg para redibujar la ventana SIN el marco:
Private Declare Function CreateRoundRectRgn Lib "gdi32" _
(ByVal X1 As Long, ByVal Y1 As Long, _
ByVal X2 As Long, ByVal Y2 As Long, _
ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" _
(ByVal hwnd As Long, ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long
Private Sub Command1_Click()
Dim lRet As Long
Dim l As Long
Dim Width As Long
Dim Height As Long
Width = Me.ScaleWidth / Screen.TwipsPerPixelX
Height = Me.ScaleHeight / Screen.TwipsPerPixelY
lRet = CreateRoundRectRgn(10, 35, Width, Height + 900, 0, 0)
l = SetWindowRgn(Me.hwnd, lRet, True)
End Sub
Para agregar un botón que cierre el programa solo tienes que escribir ésto:
Private Sub Command1_Click()
End 'Cerrar el programa
End Sub
Si lo que quieres es cerrar sólo el form
Private Sub Command1_Click()
Unload Me 'Cerrar el form
End Sub
Para minimizar:
Private Sub Command1_Click()
Me.Windowsstate = vbminimized 'Minimizar
End Sub
Un saludo.
te agradezco mucho.
pero no entendi como poner eso de API
soy muy n00b para vb estoy empezando :)
otra cosa, el boton cerrar anda perfecto pero el de minimizar me da error
una mas :P como hago para q cuando inserto un texto, al hacer doble click en el texto q agregue me habra una pagina de internet, por ejemplo google.com
gracias,
Lo q t a escrito _Sergi_ tiene errores tontos ;) este es el mismo code pero t va a funcionar.
Private Declare Function CreateRoundRectRgn Lib "gdi32" _
(ByVal X1 As Long, ByVal Y1 As Long, _
ByVal X2 As Long, ByVal Y2 As Long, _
ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" _
(ByVal hwnd As Long, ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long
Private Sub Command1_Click()
Dim lRet As Long
Dim l As Long
Dim Width As Long
Dim Height As Long
Width = Me.ScaleWidth / Screen.TwipsPerPixelX
Height = Me.ScaleHeight / Screen.TwipsPerPixelY
lRet = CreateRoundRectRgn(10, 35, Width, Height + 900, 0, 0)
l = SetWindowRgn(Me.hwnd, lRet, True)
End Sub
Private Sub Command4_Click()
End 'Cerrar el programa
End Sub
Private Sub Command2_Click()
Unload Me 'Cerrar el form
End Sub
Private Sub Command3_Click()
Me.WindowState = vbMinimized 'Minimizar
End Sub
Lo d q habra la pagina web seria asi
Set web = CreateObject("WScript.Shell")
web.Run "http://" & Text1.Text
Tan solo decirte q eso t va a servir pero si lo kieres hacer muxo mejor busca sobre la API k t abre las web ;)
Cita de: seken_C4 en 6 Junio 2006, 08:16 AM
Lo q t a escrito _Sergi_ tiene errores tontos ;) este es el mismo code pero t va a funcionar.
Private Declare Function CreateRoundRectRgn Lib "gdi32" _
(ByVal X1 As Long, ByVal Y1 As Long, _
ByVal X2 As Long, ByVal Y2 As Long, _
ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" _
(ByVal hwnd As Long, ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long
Private Sub Command1_Click()
Dim lRet As Long
Dim l As Long
Dim Width As Long
Dim Height As Long
Width = Me.ScaleWidth / Screen.TwipsPerPixelX
Height = Me.ScaleHeight / Screen.TwipsPerPixelY
lRet = CreateRoundRectRgn(10, 35, Width, Height + 900, 0, 0)
l = SetWindowRgn(Me.hwnd, lRet, True)
End Sub
Private Sub Command4_Click()
End 'Cerrar el programa
End Sub
Private Sub Command2_Click()
Unload Me 'Cerrar el form
End Sub
Private Sub Command3_Click()
Me.WindowState = vbMinimized 'Minimizar
End Sub
Lo d q habra la pagina web seria asi
Set web = CreateObject("WScript.Shell")
web.Run "http://" & Text1.Text
Tan solo decirte q eso t va a servir pero si lo kieres hacer muxo mejor busca sobre la API k t abre las web ;)
te agradezco mucho, siempre q pretunto algo me olvido de buscar :P
pero tengo dos preguntas :)
1) el codigo de la web me tira error :(
2) como hago para q cuadno abro el programa me aparezca donde esta pintado de rojo en la imagen??
http://img116.imageshack.us/img116/2857/untitled2eq1.jpg
es eso de API??
una mas, busque sobre API, pero no encontre
mi problema es.. donde tengo q poner ese codigo?? :-[ :-\
gracias,
Tienes q poner el codigo en el form ( m refiero en la parte de codear ) lo d las apis t recomeindo q t bajes el API-Guide k t hace una lista de muxas apis y t pone algunos ejemplos
Lo d q t apareza en la abajo en forma de pestaña... no tengo ni dea
Lo del error de la pagina web, pon esto :
Private Sub Text1_DblClick()
Set web = CreateObject("WScript.Shell")
web.Run "http://" & Text1.Text
End Sub
Siendo el text1 el texbox q tienes ;)
Cita de: seken_C4 en 6 Junio 2006, 16:30 PM
Tienes q poner el codigo en el form ( m refiero en la parte de codear ) lo d las apis t recomeindo q t bajes el API-Guide k t hace una lista de muxas apis y t pone algunos ejemplos
Lo d q t apareza en la abajo en forma de pestaña... no tengo ni dea
Lo del error de la pagina web, pon esto :
Private Sub Text1_DblClick()
Set web = CreateObject("WScript.Shell")
web.Run "http://" & Text1.Text
End Sub
Siendo el text1 el texbox q tienes ;)
te agradezco por tu ayuda, pero tengo un problema
cuando pongo proyecto nuevo y agrego un text y pongo para q abra la web, anda perfecto, pero cuando lo pongo en el proyecto q estoy haciendo me tira este error
http://img387.imageshack.us/img387/3689/untitled6dr.jpg
alguien sabe por q?:(
si alguien sabe esto
Citarcomo hago para q cuadno abro el programa me aparezca donde esta pintado de rojo en la imagen??
http://img116.imageshack.us/img116/2857/untitled2eq1.jpg
se lo agradeceriaa mucho :)
Citarcomo hago para q cuadno abro el programa me aparezca donde esta pintado de rojo en la imagen??
Private Sub Form_Load()
WindowState = 1
End Sub
les agradezco mucho :D
lo unico q no me funciono fue lo siguiente :(
Citarcuando pongo proyecto nuevo y agrego un text y pongo para q abra la web, anda perfecto, pero cuando lo pongo en el proyecto q estoy haciendo me tira este error
http://img387.imageshack.us/img387/3689/untitled6dr.jpg
alguien sabe por q?
gracias,