Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems with an invisible form
I am using an invisible form in an application by using
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _ (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long I call SetWindowLong several times in the form's Initialize method(I don't use the initialize event) to set all of the visible elements such as the border, the caption, the dialogue frame and also set the form to transparent. Then when I Show the form it the form is invisible. This all works fine most of the time except in one case where I Unload the form and show another (visible) form. When I then hide (or unload) the second form and then initialize and show the invisible form again it is not transparent (controls on the form and the form body are visible but the border, caption etc. are still off). The strange thing is that I am using only two forms other than the invisible one, one Modal and one non-Modal and this only happens with the Modal form. To get the invisible form back to being transparent I can run a routine with only the line Application.ScreenUpdate = true in it from a key press in the form's KeyUp event (or set an OnTime event for one second after the form is shown to run the same routine). None of this is very elegant so my question is this: Is there a way of running a piece of code automatically after the form has been Shown? Do I have a timing problem here? Or is there another way around this? Incidentally I have tried putting Application.ScreenUdatating = true in the Initialize and Activate events but it only makes the form non-transparent every time it is Shown. Seiscons |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VB Form vs VBA UserForm problems... | Excel Programming | |||
VB Form vs VBA UserForm problems... | Excel Programming | |||
VB Form vs VBA UserForm problems... | Excel Programming | |||
form problems | Excel Programming | |||
problems with a multitab form | Excel Programming |