Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    [VB6] - Spostare oggetti all'evento Form_Resize

    Salve,
    avrei bisogno di un codice ke mi serva per spostare / ingrandire degli oggetti in un form all'evento resize.
    Ho provato con questo, ma mi va in loop infinito, perchè mi si blocca il vb...

    codice:
    Private intLarMassima As Integer
    Private intAltMassima As Integer
    Private mblnResize As Boolean
    
    Private Sub Resize()
    On Error Resume Next
    
        Do While (Me.Width >= intLarMassima) And (Me.Height >= intAltMassima)
            If mblnResize = True Then
                Frame1.Width = (Me.Width - Larghezza) + Frame1.Width
                Frame1.Height = (Me.Height - Altezza) + Frame1.Height
                Text1.Width = (Me.Width - Larghezza) + Text1.Width
                Command1.Top = (Me.Height - Altezza) + Command1.Top
            End If
        Loop
        
    End Sub
    
    Private Sub Form_Load()
    
    Larghezza = Me.Width
    Altezza = Me.Height
    mblnResize = True
    intLarMassima = 5055
    intAltMassima = 4125
    
    End Sub
    
    Private Sub Form_Resize()
    
    Resize
            Larghezza = Me.Width
            Altezza = Me.Height
    
    End Sub
    Ringrazio kiunque sappia qualcosa e mi risponda!

  2. #2
    codice:
    ...
        if (Me.Width >= intLarMassima) And (Me.Height >= intAltMassima) and (mblnResize) then
            Frame1.Width = (Me.Width - Larghezza) + Frame1.Width
            Frame1.Height = (Me.Height - Altezza) + Frame1.Height
            Text1.Width = (Me.Width - Larghezza) + Text1.Width
            Command1.Top = (Me.Height - Altezza) + Command1.Top
        end if

  3. #3
    grazie socket 2000. io ci ho provato ma nn funziona al load già me li allarga tutti gli oggetti...non è ke c'è qualcuno ke sappia come fare x risolvere qst problema???

  4. #4
    Durante il load viene richiamato l'evento resize...

  5. #5
    si,grazie socket ..ci ho provato e ci sono riuscito...però vorrei ke gli oggetti si spostassero in proporzione all'allargamento-restringimento del form.. nessuno saprebbe come fare? ringrazio in anticipo ki mi risponderà...

  6. #6
    codice:
    if Me.windowstate <> vbMinimized then
            Frame1.Width = (Me.Width - Larghezza) + Frame1.Width
            Frame1.Height = (Me.Height - Altezza) + Frame1.Height
            Text1.Width = (Me.Width - Larghezza) + Text1.Width
            Command1.Top = (Me.Height - Altezza) + Command1.Top
     end if

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.