Programación General > Visual Basic 6.0 e inferiores

 Podedr Mnimozar Cuando Quiera Y Cuando Quiera No

(1/2) > >>

Bopo:
Esop. :huh: , que si se apreta un boton el form se pueda minimizar y si se apreta otro no se pueda minimizaar :P ... soy un ignorante :ph34r:

ebolo:
Lo unico que se me ha ocurrido es lo siguiente:

--------------------------------------
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub

Private Sub Command2_Click()
Timer1.Enabled = False
End Sub

Private Sub Form_Load()
Timer1.Interval = 50
End Sub

Private Sub Timer1_Timer()
If Form1.WindowState = 1 Then Form1.WindowState = 0
End Sub
---------------------------------------
Pones 2 botones command y un timer.
Por lo que he comprobado usar las propiedades del form "Maxbutton" y "Minbutton" no se puede dentro de código porque da error.
Saludos.

Bopo:

--- Cita de: "ebolo" --- Lo unico que se me ha ocurrido es lo siguiente:

--------------------------------------
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub

Private Sub Command2_Click()
Timer1.Enabled = False
End Sub

Private Sub Form_Load()
Timer1.Interval = 50
End Sub

Private Sub Timer1_Timer()
If Form1.WindowState = 1 Then Form1.WindowState = 0
End Sub
---------------------------------------
Pones 2 botones command y un timer.
Por lo que he comprobado usar las propiedades del form "Maxbutton" y "Minbutton" no se puede dentro de código porque da error.
Saludos.
--- Fin de la cita ---
Excelente solucion :D

Brroz:
Más fácil:


--- Código: Text --- Private indAllowMinimize as booleanPrivate intWindowState as integer Private Sub Form_Load    Comman1.Caption = "Permir minimizar"End Sub Private Sub Command1_Click   IndAllowMinimize = Not indAllowMinimize   If indAllowMinimize Then        Command1.Caption = "No permitir minimizar"   Else        Command1.Caption = "Permitir minimizar"        intWindowState = 0   End IfEnd Sub Private Sub Form_Resize()   If Me.WindowState = 1 And Not indAllowResize Then      Me.WindowState = intWindowState   Else      intWindowState = Me.WindowState   End IfEnd Sub   
Suerte.

ebolo:
Hola a todos.
Todos los días se aprende algo.
Brroz:
---------------------------------
Private Sub Form_Resize()
  If Me.WindowState = 1 And Not indAllowResize Then  
........
---------------------------------
¿No debería ser:?
  If Me.WindowState = 1 And Not indAllowMinimize Then  
.........
----------------------------------
Saludos.

Navegación

[0] Índice de Mensajes

[#] Página Siguiente

Ir a la versión completa