vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Schützen Sie Ihre Software vor Software-Piraterie - mit sevLock 1.0 DLL!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2024
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB & Windows API
Re: SetWindowPos: Bug? Fenster nicht oben! 
Autor: RapID23o5
Datum: 11.03.05 16:09

' - - - - - - - - - - - - - - - - - - - - - - -
' Erstelle 5 Formen
' Namen: Form1 - Form4, Topper
'
' Erstelle 6 CommandButtons auf Form1
' Namen: Command1 - Command6
'
' Füge Nachfolgenden code in den Privaten Deklarations Bereich der Form1
' Aussprobieren und spass haben ... ;)
' - - - - - - - - - - - - - - - - - - - - - - -
' Ich denke mal der restliche Code erklärt sich von selbst!
' - - - - - - - - - - - - - - - - - - - - - - -
 
Option Explicit
 
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 SetTopLevelWindow(ByVal hWnd As Long, Optional topmost As Boolean = _
  True)
    Const HWND_NOTOPMOST = -2
    Const HWND_TOPMOST = -1
    Const SWP_NOMOVE = &H2
    Const SWP_NOSIZE = &H1
    SetWindowPos hWnd, IIf(topmost, HWND_TOPMOST, HWND_NOTOPMOST), 0, 0, 0, 0, _
      SWP_NOMOVE + SWP_NOSIZE
    SetWindowPos Me.hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
End Sub
 
Private Sub Command1_Click()
SetTopLevelWindow Form2.hWnd
End Sub
 
Private Sub Command2_Click()
SetTopLevelWindow Form3.hWnd
End Sub
 
Private Sub Command3_Click()
SetTopLevelWindow Form4.hWnd
End Sub
 
Private Sub Command4_Click()
SetTopLevelWindow Form2.hWnd, False
End Sub
 
Private Sub Command5_Click()
SetTopLevelWindow Form3.hWnd, False
End Sub
 
Private Sub Command6_Click()
SetTopLevelWindow Form4.hWnd, False
End Sub
 
Private Sub Form_Initialize()
Command1.Caption = "Form2 Top"
Command2.Caption = "Form3 Top"
Command3.Caption = "Form4 Top"
Command4.Caption = "Form2 NotTop"
Command5.Caption = "Form3 NotTop"
Command6.Caption = "Form4 NotTop"
Command1.Move 240, 2000, 800, 500
Command2.Move 240, 2500, 800, 500
Command3.Move 240, 3000, 800, 500
Command4.Move 1040, 2000, 800, 500
Command5.Move 1040, 2500, 800, 500
Command6.Move 1040, 3000, 800, 500
End Sub
 
Private Sub Form_Load()
Form1.Move 1000, 1000, 2200, 5000
Form2.Move 1000, 1000, 50, 50
Form3.Move 1500, 1100, 50, 50
Form4.Move 2000, 1200, 50, 50
Topper.Move -1000, -1000, 0, 0
Form2.Show
Form3.Show
Form4.Show
Topper.Show
SetTopLevelWindow Form2.hWnd
SetTopLevelWindow Form3.hWnd
SetTopLevelWindow Form4.hWnd
SetTopLevelWindow Topper.hWnd
End Sub

Ohne Mampf, kein Kampf !

alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
SetWindowPos: Bug? Fenster nicht oben!7.850E716.02.05 15:03
Re: SetWindowPos: Bug? Fenster nicht oben!3.431ModeratorMartoeng16.02.05 15:42
Re: SetWindowPos: Bug? Fenster nicht oben!3.101E716.02.05 16:06
Re: SetWindowPos: Bug? Fenster nicht oben!2.908ModeratorMartoeng16.02.05 19:24
Re: SetWindowPos: Bug? Fenster nicht oben!2.843E716.02.05 19:29
Re: SetWindowPos: Bug? Fenster nicht oben!2.752ModeratorMartoeng17.02.05 18:54
Re: SetWindowPos: Bug? Fenster nicht oben!2.835E717.02.05 20:03
Re: SetWindowPos: Bug? Fenster nicht oben!2.777Guido Eisenbeis02.03.05 01:28
Re: SetWindowPos: Bug? Fenster nicht oben!2.738E702.03.05 14:03
Re: SetWindowPos: Bug? Fenster nicht oben!2.679Guido Eisenbeis02.03.05 21:07
Re: SetWindowPos: Bug? Fenster nicht oben!2.691E703.03.05 13:55
Re: SetWindowPos: Bug? Fenster nicht oben!2.659RapID23o510.03.05 15:40
Re: SetWindowPos: Bug? Fenster nicht oben!2.620E710.03.05 19:30
Re: SetWindowPos: Bug? Fenster nicht oben!2.826RapID23o511.03.05 16:09
Re: SetWindowPos: Bug? Fenster nicht oben!2.743E711.03.05 17:58
Re: SetWindowPos: Bug? Fenster nicht oben!2.589BasTler14.04.05 13:34
Re: SetWindowPos: Bug? Fenster nicht oben!2.853BasTler14.04.05 13:53
Re: SetWindowPos: Bug? Fenster nicht oben!2.532E714.04.05 18:07
Re: SetWindowPos: Bug? Fenster nicht oben!2.804RapID23o503.06.05 16:03
Re: SetWindowPos: Bug? Fenster nicht oben!2.653ModeratorMartoeng03.06.05 18:03
Re: SetWindowPos: Bug? Fenster nicht oben!2.737E704.06.05 19:58

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2024 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel