LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Fun with Userforms!!!!

I normally create and show a basic userform by using the following
code:

Userform1.Show ' Show the basic userfom


However, I have recently discovered a new way to display
a userform which involves using the code and definitions
below:
--------------------------------------------------------------------------------
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLongA Lib "user32" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_HWNDPARENT As Long = -8

Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindow("ThunderDFrame", Me.Caption)
SetWindowLongA hWnd, GWL_HWNDPARENT, 0&
End Sub
-------------------------------------------------------------------------------

Then I load this "ThunderDFrame" form using the following call:

UserForm1.Show (vbModeless) ' Show ThunderDFrame as modeless



So..... I was wondering if it's possible to transform the "basic" userform
style described above into the "ThunderDForm" descibed above??? I am
basically interested in toggling my userform back and forth between
the basic style and ThunderDFrame styles when the form is loaded??
I think this is possible with the Win32 API & Visual C++...so I'm wondering
if I can do it with VBA as well???

Thank you everyone!


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForms sparx[_6_] Excel Programming 1 June 25th 06 09:30 PM
Userforms Greg[_20_] Excel Programming 1 April 4th 06 10:12 AM
Esc out of userforms Mark \(InWales\)[_23_] Excel Programming 2 February 2nd 05 10:08 PM
Userforms..... Candee[_8_] Excel Programming 1 November 27th 03 06:02 PM
userforms again... Jo[_4_] Excel Programming 3 September 21st 03 12:31 AM


All times are GMT +1. The time now is 06:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"