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

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


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

Desconectado Desconectado

Mensajes: 38


Ver Perfil
[Ayuda] Form
« en: 18 Septiembre 2010, 20:27 pm »

Cómo hago para que el Form no se puede modificar el tamaño, es decir que no se expansible Gracias


En línea

raul338


Desconectado Desconectado

Mensajes: 2.633


La sonrisa es la mejor forma de afrontar las cosas


Ver Perfil WWW
Re: [Ayuda] Form
« Respuesta #1 en: 18 Septiembre 2010, 20:34 pm »

Cambia el BorderStyle por Fixed Dialog


En línea

Elemental Code


Desconectado Desconectado

Mensajes: 622


Im beyond the system


Ver Perfil
Re: [Ayuda] Form
« Respuesta #2 en: 20 Septiembre 2010, 16:05 pm »

ahora si necesitas que sea maximizable pero que no lo puedas cambiar de tamaño
en el evento Form rezise pones algo asi

Código
  1. on error resume next
  2. me.height = X
  3. me.width = Y

X e Y son el alto y ancho respectivamente
En línea

I CODE FOR $$$
Programo por $$$
Hago tareas, trabajos para la facultad, lo que sea en VB6.0

Mis programas
Dessa


Desconectado Desconectado

Mensajes: 624



Ver Perfil
Re: [Ayuda] Form
« Respuesta #3 en: 26 Septiembre 2010, 13:38 pm »

En Diseño es como te dice raul y si necesitas cambiar en ejecución se puede usar SetWindowLong (sirve tambien para formularios sin borde)

Código:
Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
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

Private Sub Form_Load()
  Command1.Caption = "FIXED"
  Command2.Caption = "SIZEABLE"
End Sub

Private Sub Command1_Click()
  Call SetWindowLong(Me.hwnd, &HFFF0, GetWindowLong(Me.hwnd, &HFFF0) And Not &H40000)
  Call SetWindowPos(Me.hwnd, &H0, &H0, &H0, &H0, &H0, &H20 Or &H2 Or &H4 Or &H1)
End Sub

Private Sub Command2_Click()
  Call SetWindowLong(Me.hwnd, &HFFF0, GetWindowLong(Me.hwnd, &HFFF0) Or &H40000)
  Call SetWindowPos(Me.hwnd, &H0, &H0, &H0, &H0, &H0, &H20 Or &H2 Or &H4 Or &H1)
End Sub




En línea

Adrian Desanti
Psyke1
Wiki

Desconectado Desconectado

Mensajes: 1.089



Ver Perfil WWW
Re: [Ayuda] Form
« Respuesta #4 en: 26 Septiembre 2010, 14:22 pm »

Dessa porque no utilizas constantes?
Creo que quedaria mas claro :P

DoEvents! :P
En línea

Dessa


Desconectado Desconectado

Mensajes: 624



Ver Perfil
Re: [Ayuda] Form
« Respuesta #5 en: 26 Septiembre 2010, 16:24 pm »

Ahí va con constantes, Psyke.

Código:

Option Explicit

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_SIZEBOX = &H40000

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

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

Private Const SWP_REFRESH = SWP_NOSIZE Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_FRAMECHANGED

Private Sub Form_Load()
  Command1.Caption = "FIXED"
  Command2.Caption = "SIZEABLE"
End Sub

Private Sub Command1_Click()
  Dim lngstylo As Long
  lngstylo = GetWindowLong(Me.hwnd, GWL_STYLE) And Not WS_SIZEBOX
  Call SetWindowLong(Me.hwnd, GWL_STYLE, lngstylo)
  Call SetWindowPos(Me.hwnd, &H0, &H0, &H0, &H0, &H0, SWP_REFRESH)
End Sub

Private Sub Command2_Click()
  Dim lngstylo As Long
  lngstylo = GetWindowLong(Me.hwnd, GWL_STYLE) Or WS_SIZEBOX
  Call SetWindowLong(Me.hwnd, GWL_STYLE, lngstylo)
  Call SetWindowPos(Me.hwnd, &H0, &H0, &H0, &H0, &H0, SWP_REFRESH)
End Sub



En línea

Adrian Desanti
seba123neo
Moderador
***
Desconectado Desconectado

Mensajes: 3.621



Ver Perfil WWW
Re: [Ayuda] Form
« Respuesta #6 en: 26 Septiembre 2010, 22:29 pm »

ahora si necesitas que sea maximizable pero que no lo puedas cambiar de tamaño
en el evento Form rezise pones algo asi

Código
  1. on error resume next
  2. me.height = X
  3. me.width = Y

X e Y son el alto y ancho respectivamente

con ese codigo habria un horrible flickering del formulario, es mejor hacer un Hook a WM_GETMINMAXINFO

saludos.
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Ayuda con un form y php
PHP
krono0x 5 2,260 Último mensaje 25 Febrero 2012, 04:26 am
por krono0x
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines