Help, I want my form ALWAYS staying on top of ANY other window 
Author Message
 Help, I want my form ALWAYS staying on top of ANY other window

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

  vcard.vcf
< 1K Download


Mon, 26 Mar 2001 03:00:00 GMT  
 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       **
***************************************



Mon, 26 Mar 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Does anybody know how to make an external applicatoin's window always stay on top

2. Making a form always stay on top.

3. Make a form always stay on top

4. form that always stay on top

5. I'm trying to make the form always stay on top

6. Make a window always on top (of every window..always)

7. make an app always staying at the top

8. Window/Form Focus + Always on Top

9. Form, stay on top - Help

10. Form, stay on top - Help

11. Make a form always on top - always

12. window always on top HELP Please

 

 
Powered by phpBB® Forum Software