
Help, I want my form ALWAYS staying on top of ANY other window
Quote:
> Hi,
> I want my form always staying on top of any other window
> How do I do that.?
> Is there a property that does the job?
> (WIN 98-VB 5.0)
> Email please
You need to use the Windows API - VB does not have it's own method to
perform this operation. You need to use the SetWindowPos function in
User32.dll. To use this you need the following code in the General
Declarations section of your form (all on one line - omit the private if
placed in a code module)
Private Declare Function SetWindowPos Lib "user32" (ByVal h As Long,
ByVal hb%, ByVal x%, ByVal y%, ByVal cx%, ByVal cy%, ByVal f%) As
Integer
Place the following code in Form_Load (Replace Me with the name of your
form if making it always on top from another form/module):
Dim ret As Integer
ret = SetWindowPos(Me.hWnd, -1, 0, 0, 0, 0, 2 Or 1)
Hope this helps.
--
***************************************
** EMail Sent By Peter Denton **
** Phone: (01274) 232559 **
***************************************