elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  ayuda con menu
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: ayuda con menu  (Leído 1,294 veces)
bautistasbr

Desconectado Desconectado

Mensajes: 268


Ver Perfil
ayuda con menu
« en: 10 Marzo 2006, 19:52 pm »

ola,tengo una dudilla.lo que quiero hacer es q cuando se pulse un boton,se me oculte el menu y la barra de donde esta la X para cerrar el programa.Tengo este codigo

If mnuarch.Visible = True Then
mnuarch.Visible = False
End If
If mnucont.Visible = True Then
mnucont.Visible = False
End If
If mnuayu.Visible = True Then
mnuayu.Visible = False
End If
If mnuacc.Visible = True Then
mnuacc.Visible = False
End If

nose como hacer lo demas y para q cuando pulse oculte y muestre la barra y el menu


En línea

.Slasher-K.

Desconectado Desconectado

Mensajes: 79


Ver Perfil
Re: ayuda con menu
« Respuesta #1 en: 10 Marzo 2006, 20:12 pm »

Código:
    Dim csControl

  For Each csControl In Controls
    If TypeOf csControl Is Menu Then
      csControl.Visible = Not csControl.Visible
    End If
  Next


En línea

bautistasbr

Desconectado Desconectado

Mensajes: 268


Ver Perfil
Re: ayuda con menu
« Respuesta #2 en: 10 Marzo 2006, 20:25 pm »

muchisimas gracias,funciona a la perfeccion.Pero tengo otra duda.

Como cambio el borde del formulario de sizable a none?
En línea

.Slasher-K.

Desconectado Desconectado

Mensajes: 79


Ver Perfil
Re: ayuda con menu
« Respuesta #3 en: 10 Marzo 2006, 20:52 pm »

Código:
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
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

Const GWL_STYLE = (-16)

Const WS_CAPTION = &HC00000
Const WS_OVERLAPPED = &H0&
Const WS_SYSMENU = &H80000
Const WS_THICKFRAME = &H40000
Const WS_MINIMIZEBOX = &H20000
Const WS_MAXIMIZEBOX = &H10000
Const WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)

Const SWP_NOMOVE = &H2
Const SWP_FRAMECHANGED = &H20
Const SWP_NOSIZE = &H1
Const SWP_NOZORDER = &H4

Private Sub ShowBorder(Optional bShow As Boolean = True)
  If bShow Then
    Call SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) Or WS_OVERLAPPEDWINDOW)
  Else
    Call SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) And Not WS_OVERLAPPEDWINDOW)
  End If
 
  Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_NOSIZE)
End Sub

En línea

bautistasbr

Desconectado Desconectado

Mensajes: 268


Ver Perfil
Re: ayuda con menu
« Respuesta #4 en: 10 Marzo 2006, 21:23 pm »

no funciona,me da error en esta zona

Private Sub ShowBorder(Optional bShow As Boolean = True)
  If bShow Then
    Call SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) Or WS_OVERLAPPEDWINDOW)
  Else
    Call SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) And Not WS_OVERLAPPEDWINDOW)
  End If
 
  Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_NOSIZE)
End Sub
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Ayuda :D Menu
Programación C/C++
wossy666 2 1,864 Último mensaje 2 Agosto 2011, 09:34 am
por PiroskY
Ayuda con pantalla de menu
Programación Visual Basic
yogova9 3 1,292 Último mensaje 21 Octubre 2011, 01:08 am
por BlackZeroX
Ayuda con un menú « 1 2 »
Desarrollo Web
chocola 18 6,009 Último mensaje 5 Enero 2012, 20:15 pm
por chocola
Ayuda Con menu C++ 4.9.9.4
Programación C/C++
estivinho 2 1,613 Último mensaje 25 Octubre 2012, 04:36 am
por estivinho
Ayuda con c++ en un menu
Programación C/C++
rusoko 2 1,640 Último mensaje 20 Abril 2014, 11:29 am
por amchacon
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines