By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,002 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,002 IT Pros & Developers. It's quick & easy.

ShowDialog(Me) does not function with AnimateWindow API

P: n/a
Tim
Dear All,

I have discovered, to my dismay, that the ShowDialog function will not
function correctly when used with the AnimateWindow API. The owned
form is opened behind the owning form on the second consecutive call,
which goes against the principles of the ShowDialog function. Does
anyone know a work around that still allow the for the use of the
AnimateWindoe API ? Or should I just forget about this API ?

Does anyone else use this API?

Regards,

Tim

CODE:
'USED TO OPEN WINDOWS IN ANIMATION STYLE
Private Declare Auto Function AnimateWindow Lib "user32.dll"
(ByVal hWnd As Integer, _
ByVal
dwTime As Integer, _
ByVal
dwFlags As Integer _
) As
Boolean
'HOLDS DIFFERENT ANIMATION STYLES
Public Enum AnimateStyles
Slide = 262144
Activate = 131072
Blend = 524288
Hide = 65536
Center = 16
HOR_Positive = 1
HOR_Negative = 2
VER_Positive = 4
VER_Negative = 8
End Enum
Private Sub GetContact()
Try
'CREATE A NEW INSTANCE OF THE ORGANISATIONS FORM FOR
SELECTION OF A PERSON
Dim ofrmOrganisations As New
frmOrganisations(contacts.frmOrganisations.FormOpe ration.PersonSelection)

'SET BASIC SETTINGS
With ofrmOrganisations
.ShowInTaskbar = False
.StartPosition =
Windows.Forms.FormStartPosition.Manual
End With

'ADD REFERENCE FOR EVENT HANDLER FOR WHEN USER HAS
SELECTED A PERSON
AddHandler ofrmOrganisations.PersonSelected, AddressOf
OnPersonSelected

'API RETURNS WHEN THE BLEND IS COMPLETED
AnimateWindow(ofrmOrganisations.Handle.ToInt32, 100,
AnimateStyles.Blend)
'DISPLAY FORM
ofrmOrganisations.ShowDialog(Me)

Catch excep As System.Exception
'CATCHES ALL ERRORS
MessageBox.Show("Message: " & excep.Message)

End Try

End Sub
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <10**************************@posting.google.com >, Tim wrote:
Dear All,

I have discovered, to my dismay, that the ShowDialog function will not
function correctly when used with the AnimateWindow API. The owned
form is opened behind the owning form on the second consecutive call,
which goes against the principles of the ShowDialog function. Does
anyone know a work around that still allow the for the use of the
AnimateWindoe API ? Or should I just forget about this API ?

Does anyone else use this API?

Regards,

Tim


Tim,

I have never used this API call, so I can't really answer your question
- but I think you might have better luck with it over on the framework
interop group:

microsoft.public.dotnet.framework.interop

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 1 Build 2600
System Up Time: 0 Days, 20 Hours, 9 Minutes, 48 Seconds
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.