Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2003
    Messaggi
    173

    [vb6] bordo form

    Ciao a tutti.
    Ho un problemino: nel mio progetto in Vb6 ho dei form senza bordo (borderstyle = none).Il fatto è che vorrei poterli spostare col mouse, ma questo mi sembra non sia possibile se imposto la proprietà
    borderstyle = none. Per altri valori di tale proprietà invece riesco (fixed single, sizable etc..).
    Non è proprio possibile? Devo per forza avere un bordo nel form per poterlo spostare?
    Grazie.

  2. #2
    Utente di HTML.it L'avatar di junx
    Registrato dal
    May 2004
    Messaggi
    322
    codice:
    Const HTCAPTION = 2
    Const WM_NCLBUTTONDOWN = &HA1
    Private Declare Function ReleaseCapture Lib "user32" () As Long
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
        (ByVal hwnd As Long, _
        ByVal wMsg As Long, _
        ByVal wParam As Long, lParam As Long) As Long
    
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
            x As Single, Y As Single)
        If Button = 1 Then
            Dim ReturnVal As Long
            x = ReleaseCapture()
            ReturnVal = SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
        End If
    End Sub
    Ciao!

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2003
    Messaggi
    173
    Perfetto, era proprio quello che cercavo!!!
    Grazie!

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.