Creating Wait window like effect 
Author Message
 Creating Wait window like effect

Dear friends,

I m trying to create a form, which wil display validation check error
msgs to the user. for example - before saving record check if all
required fields entered, if not display err msg window.

This form will be displayed on top of the other form for which the
validation message is displayed, preferably in the top right corner.
And when the user presses any key/clicks mouse it will be unloaded.

my questions 1. how to display form on top of the application in the
                fixed position at top right corner.
             2. how to trap any key pressed / mouse click by the user
                anywhere in the application, not necessarily on that
                form only.

Any help will be appreciated.

Nitin.



Tue, 26 Oct 2004 09:18:07 GMT  
 Creating Wait window like effect

Quote:

> my questions 1. how to display form on top of the application in the
>                 fixed position at top right corner.

There is no such thing as an "application container".

Here's a function I use to display a form on the top of *Windows* in
the lower right hand corner. You should be able to substitute "1" for
iTop and be okay with the right hand corner. If you have an object
acting as the application container (like another form), substitute
the Form.Top and Form.Left parameters as appropriate.

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

Public Sub StayOnTop(frmForm As Form, fOnTop As Boolean)
  Const HWND_TOPMOST = -1
  Const HWND_NOTOPMOST = -2

  Dim lState As Long
  Dim iLeft As Integer, iTop As Integer, iWidth As Integer, iHeight As
Integer

  With frmForm
    iLeft = .Left / Screen.TwipsPerPixelX
    iTop = .Top / Screen.TwipsPerPixelY
    iWidth = .Width / Screen.TwipsPerPixelX
    iHeight = .Height / Screen.TwipsPerPixelY
  End With
  If fOnTop Then
    lState = HWND_TOPMOST
  Else
    lState = HWND_NOTOPMOST
  End If
  Call SetWindowPos(frmForm.hwnd, lState, iLeft, iTop, iWidth,
iHeight, 0)

End Sub

As far as the on top thing, why not just open the form modally?

Quote:
>              2. how to trap any key pressed / mouse click by the user
>                 anywhere in the application, not necessarily on that
>                 form only.

I don't know a specific way, but it would be easy to create a module
with the routines you need (passing the form it came from even, the
keys, etc.) and have all forms pass the key trapping and mouse
trapping from there. You can also use the API to trap the Windows
events from the entire OS, I think??
Quote:
> Any help will be appreciated.



Wed, 27 Oct 2004 04:35:35 GMT  
 Creating Wait window like effect
Thanks a lot for that guidance. I will consider the suggestion for
displaying the form modally.

Nitin.



Wed, 27 Oct 2004 09:22:43 GMT  
 Creating Wait window like effect
But the modal form also i still need to position it in the corner of
the screen not in the centre.

Nitin.



Wed, 27 Oct 2004 09:24:29 GMT  
 Creating Wait window like effect

Quote:

> But the modal form also i still need to position it in the corner of
> the screen not in the centre.

Hmm, if you run that StayOnTop thing inside the modal form on
Form_Load does it not do that? The StayOnTop thing incidentally also
allows a form to stay on top of *all* applications (by the fOnTop
function), but the bulk of the function sets the form to move to the
bottom right corner. Modifying the code to the top right corner should
be simple.

Sorry for the confusion as far as the function name goes. That's my
sucky naming schemes for you. :)



Sat, 30 Oct 2004 00:05:49 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. creating wait window like effect

2. create a fade effect or any other effect like morph between two open forms

3. Creating the same effect as Outlook's grouped messages window

4. Waiting.......waiting.....waiting....

5. Create Panel Animation effect

6. How to create OnMouseOver effect in VB

7. Need help creating an ActiveX Control Rollover effect

8. need help creating a water effect

9. creating a mirror effect

10. Creating a look through lense effect in vb.

11. QB45: strange effect with VIEW, WINDOW, GET/PUT

12. Playing windows media player visual effects?

 

 
Powered by phpBB® Forum Software