Visualizzazione dei risultati da 1 a 4 su 4

Discussione: mdiform

  1. #1

    mdiform

    ciao, come si fa ad impedire ad un mdiform di ridimensionarsi o di massimizzarsi/minimizzarsi?
    perla

  2. #2
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994

    Un modo è questo se parli di VB...

    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 GetWindowLong Lib "user32" Alias "GetWindowLongA" _
    (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    Const WS_THICKFRAME = &H40000
    Const WS_MINIMIZEBOX = &H20000
    Const WS_MAXIMIZEBOX = &H10000
    Const WS_SYSMENU = &H80000
    Const GWL_STYLE = (-16)


    Private Sub MDIForm_Load()
    SetWindowLong Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, _
    GWL_STYLE) And Not (WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)

    End Sub

    L'unica cosa e che i tasti(compreso quello di chiusura) non vengono disabilitati ma tolti
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

  3. #3
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994

    Oppure

    Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
    Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
    Private Const MF_BYPOSITION = &H400&

    Private vgl_Height As Long
    Private vgl_Width As Long

    Public Sub DisableMaxButton(lhWnd As Long)
    Dim hSystemMenu As Long
    hSystemMenu = GetSystemMenu(lhWnd, 0)
    Call RemoveMenu(hSystemMenu, 4, MF_BYPOSITION)
    End Sub
    Public Sub DisableMinButton(lhWnd As Long)
    Dim hSystemMenu As Long
    hSystemMenu = GetSystemMenu(lhWnd, 0)
    Call RemoveMenu(hSystemMenu, 3, MF_BYPOSITION)
    End Sub

    Private Sub MDIForm_Load()
    With Me
    vgl_Height = .Height
    vgl_Width = .Width
    DisableMaxButton .hwnd
    DisableMinButton .hwnd
    End With
    End Sub

    Private Sub MDIForm_Resize()
    With Me
    If .WindowState <> 1 Then
    .WindowState = 0
    .Height = vgl_Height
    .Width = vgl_Width
    End If
    End With
    End Sub

    'Tasti clikkabili ma non funzionanti
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

  4. #4
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994
    Private Const WS_MINIMIZEBOX = &H20000
    Private Const WS_MAXIMIZEBOX = &H10000
    Private Const GWL_STYLE = (-16)

    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 GetWindowLong Lib "user32" Alias _
    "GetWindowLongA" (ByVal hwnd As Long, _
    ByVal nIndex As Long) As Long


    Private Sub MDIForm_Load()
    Dim L As Long

    L = GetWindowLong(Me.hwnd, GWL_STYLE)
    L = L And Not (WS_MINIMIZEBOX)
    L = L And Not (WS_MAXIMIZEBOX)
    L = SetWindowLong(Me.hwnd, GWL_STYLE, L)
    End Sub

    'Rimane solo il tasto di chiusura secondo me è il migliore
    Non so darti altre informazioni al riguardo
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.