Always on top problem.

Tags:    visual-basic

Jeg bruger denne kode til at få formen til altid at være på toppen

<pre>
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

Const HWND_TOPMOST = -1
Const SWP_SHOWWINDOW = &H40

Private Sub Form_Load()
Dim TempValue As Long
Dim MyWidth As Long, MyHeight As Long
Dim MyTop As Long, MyLeft As Long

Form1.Height= Form1.Label1.Height + 100
Form1.Width = Form1.Label1.Width + 100

Form1.Left = Screen.Width - Form1.Width
Form1.Top = 0


MyWidth = Form1.Width
MyHeight = Form1.Height

MyTop = Form1.Top
MyLeft = Form1.Left


'Call SetWindowPos API function
TempValue = SetWindowPos(Form1.hwnd, HWND_TOPMOST, MyLeft, MyTop, MyWidth, MyHeight, SWP_SHOWWINDOW)

End Sub
</pre>

Men når jeg køre programmet kan jeg ikke se formen

Mvh.
Thomas Christensen
-------------------------------------------------------
Visual Basic noget for dig?
tjek Visual Basic-Gruppen
http://www.udvikleren.dk/groups/?gid=41



1 svar postet i denne tråd vises herunder
1 indlæg har modtaget i alt 2 karma
Sorter efter stemmer Sorter efter dato
Brug:

Fold kodeboks ind/udKode 




/AC



t