Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Minimize a form
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michel Pierron  
View profile  
 More options Feb 6 2005, 4:44 am
Newsgroups: microsoft.public.excel.programming
From: "Michel Pierron" <michel.pier...@free.fr>
Date: Sun, 6 Feb 2005 10:44:26 +0100
Local: Sun, Feb 6 2005 4:44 am
Subject: Re: Minimize a form
Hi kurb,
not need dll or activeX
In UserForm module:
Option Explicit
Private Declare Function FindWindow& Lib "user32" Alias _
 "FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
Private Declare Function SetWindowLong& Lib "user32" Alias _
 "SetWindowLongA" (ByVal hWnd&, ByVal nIndex& _
, ByVal dwNewLong&)
Private Declare Function EnableWindow& Lib "user32" _
 (ByVal hWnd&, ByVal fEnable&)
Private Declare Function ShowWindow& Lib "user32" _
 (ByVal hWnd&, ByVal nCmdShow&)
Private hWnd As Long

' Minimize in application
Private Sub UserForm_Initialize()
' Min: &H20000 / Max: &H10000 / Resize: &H40000
'Dim Style As Long
'Style = &H84C80080 Or &H20000 Or &H40000  ' => &H84CE0080
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84CE0080
End Sub

Private Sub UserForm_Activate()
' Minimize in TaskBar (activate following lines)
'ShowWindow hWnd, 0
'SetWindowLong hWnd, -20, &H40101
'ShowWindow hWnd, 1
' no modal userform for xl97
EnableWindow FindWindow(vbNullString, Application.Caption), 1
End Sub

In standard module:
Sub FormShow()
#If VBA6 Then
UserForm1.Show 0
#Else
UserForm1.Show
#End If
End Sub

Regards,
MP

"kurb" <momp...@sympatico.ca> a écrit dans le message de
news:O8PYZPwCFHA.1396@tk2msftngp13.phx.gbl...

> Hello

> I just could not find flex controls at www.vbusers.com
> (I'm looking for simple control to minimise userform)
> any suggestions appreciated
> Thanks
> K

> Alvin Hansen wrote:
> > Thanks i try that

> > alvin

> > "RB Smissaert" skrev:

> >>I had a go with that, but came to the conclusion that it was better to
make
> >>your own simple control (command button) that does exactly what you
want.

> >>RBS

> >>"Ken Macksey" <KenMack...@tnt21.com> wrote in message
> >>news:%2378QYSiBFHA.3976@tk2msftngp13.phx.gbl...

> >>>Hi

> >>>Go to www.vbusers.com and download flex controls. They are free and
give
> >>>you controls you can drop an a vba userform to do form resizing and add
> >>>min/max buttons. Just drag it onto the form and set the properties.No
> >>>programming at all for min/max buttons.

> >>>You do have to register the control using regsvr32.

> >>>HTH

> >>>Ken


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google