tutorials.de Buch-Aktion 05/2012
ERLEDIGT
JA
ANTWORTEN
2
ZUGRIFFE
572
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    G3kai G3kai ist offline Mitglied
    Registriert seit
    Sep 2008
    Ort
    NRW
    Beiträge
    18
    Hi


    Habe ein (kleines) Problem, und zwar:

    Habe ich eine Form: BorderStyle ist 0 (Kein), d.h. weder "Maximieren" noch "Schließen" oben im Fenster usw.

    Mit Border Style 0 ist die Form auch nicht bewegbar, das möchte ich aber ändern:
    Am oberen Teil der Form ist ein Image, mit diesem will ich das erreichen...

    Hier ein Bild der Form:
    http://img357.imageshack.us/my.php?i...ebitmapni6.png

    "Der obere Teil einer normalen Form (Wie nennt man das eig.?!) " :
    http://img171.imageshack.us/my.php?i...ixfocusij4.png


    Das obere Image soll also am Ende so wirken wie der obere Teil einer normalen Form bzw eines normalen Fensters, man soll also per MouseDown die Form bewegen können und per MouseUp soll die Form dann auf ihrer Position bleiben.


    Wie mach ich das?
    (Schon n' bisschen rumprobiert, es klappt aber nicht)



    MfG
    G3kai
     

  2. #2
    Avatar von wincnc
    wincnc wincnc ist offline Mitglied Platin
    Registriert seit
    Aug 2004
    Beiträge
    632
    Hallo, versuch´s mal so:
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    
    Private Declare Sub ReleaseCapture Lib "User32" ()
     
    Private Declare Function SendMessage Lib "User32" _
      Alias "SendMessageA" ( _
      ByVal hwnd As Long, _
      ByVal wMsg As Long, _
      ByVal wParam As Long, _
      lParam As Any) As Long
     
    Private Const WM_NCLBUTTONDOWN = &HA1
    Private Const HTCAPTION = 2
     
    Private Sub Picture1_MouseDown(Button As Integer, _
      Shift As Integer, X As Single, Y As Single)
      Dim lResult As Long
      If Button = 1 Then
        Call ReleaseCapture
        lResult = SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, _
          HTCAPTION, 0&)
      End If
    End Sub
     

  3. #3
    G3kai G3kai ist offline Mitglied
    Registriert seit
    Sep 2008
    Ort
    NRW
    Beiträge
    18
    Zitat Zitat von wincnc Beitrag anzeigen
    Hallo, versuch´s mal so:
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    
    Private Declare Sub ReleaseCapture Lib "User32" ()
     
    Private Declare Function SendMessage Lib "User32" _
      Alias "SendMessageA" ( _
      ByVal hwnd As Long, _
      ByVal wMsg As Long, _
      ByVal wParam As Long, _
      lParam As Any) As Long
     
    Private Const WM_NCLBUTTONDOWN = &HA1
    Private Const HTCAPTION = 2
     
    Private Sub Picture1_MouseDown(Button As Integer, _
      Shift As Integer, X As Single, Y As Single)
      Dim lResult As Long
      If Button = 1 Then
        Call ReleaseCapture
        lResult = SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, _
          HTCAPTION, 0&)
      End If
    End Sub
    Ah, so klappts!
    Danke dir
     

Ähnliche Themen

  1. Bild "blass" machen, aber trotzdem gut aussehend
    Von multimolti im Forum Sonstige Grafik-Programme
    Antworten: 2
    Letzter Beitrag: 23.06.10, 14:13
  2. Antworten: 1
    Letzter Beitrag: 19.04.10, 10:12
  3. Antworten: 2
    Letzter Beitrag: 12.10.09, 16:31
  4. ComboBox mit BorderStyle "FixedSingle"
    Von staTIX im Forum .NET Archiv
    Antworten: 4
    Letzter Beitrag: 26.11.04, 10:38
  5. Antworten: 8
    Letzter Beitrag: 14.08.03, 01:47