Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default userform question


just a simple question if there's a statement for
deactivating a form. bec its not running the form event
when i click on the spreadsheet again. if you need i have
explain a bit on why i need this.

thanks

i m using a form just to place some commandbuttons(each
associated to a macro). i have like 10 buttons so the form
is long. i want to reduce its length when its not active

wht i am using is

Private Sub UserForm_Activate()
UserForm1.Height = 231
End Sub


Private Sub UserForm_Deactivate()
UserForm1.Height = 51
End Sub

i have

userform1.show modeless
AppActivate Application.Caption

in all the macros and quite a few worksheet events(bec as
soon as i run a macro the form becomes invisible) it is
not deactivating the form even if its not in focus and so
it never reduces its height.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default userform question

Try this

Private Sub UserForm_MouseMove(ByVal Button As Integer,
ByVal Shift As Integer, ByVal X As Single, ByVal Y As
Single)
If X < 6 Or X Me.Width - 6 Or Y < 1 Or Y
Me.Height - 21 Then
Me.Height = 51
Else
Me.Height = 231
End If
End Sub


Kevin Beckham
-----Original Message-----

just a simple question if there's a statement for
deactivating a form. bec its not running the form event
when i click on the spreadsheet again. if you need i have
explain a bit on why i need this.

thanks

i m using a form just to place some commandbuttons(each
associated to a macro). i have like 10 buttons so the

form
is long. i want to reduce its length when its not active

wht i am using is

Private Sub UserForm_Activate()
UserForm1.Height = 231
End Sub


Private Sub UserForm_Deactivate()
UserForm1.Height = 51
End Sub

i have

userform1.show modeless
AppActivate Application.Caption

in all the macros and quite a few worksheet events(bec as
soon as i run a macro the form becomes invisible) it is
not deactivating the form even if its not in focus and so
it never reduces its height.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default userform question

thanks kevin. that exactly what i was looking for.

it works ok when the mouse move over it but sometimes when
i get away from it in x direction it down downsizes
itself. if you could explain me briefly that "if"
condition maybe it will work out.

thanks a lot again.


-----Original Message-----
Try this

Private Sub UserForm_MouseMove(ByVal Button As Integer,
ByVal Shift As Integer, ByVal X As Single, ByVal Y As
Single)
If X < 6 Or X Me.Width - 6 Or Y < 1 Or Y
Me.Height - 21 Then
Me.Height = 51
Else
Me.Height = 231
End If
End Sub


Kevin Beckham
-----Original Message-----

just a simple question if there's a statement for
deactivating a form. bec its not running the form event
when i click on the spreadsheet again. if you need i

have
explain a bit on why i need this.

thanks

i m using a form just to place some commandbuttons(each
associated to a macro). i have like 10 buttons so the

form
is long. i want to reduce its length when its not active

wht i am using is

Private Sub UserForm_Activate()
UserForm1.Height = 231
End Sub


Private Sub UserForm_Deactivate()
UserForm1.Height = 51
End Sub

i have

userform1.show modeless
AppActivate Application.Caption

in all the macros and quite a few worksheet events(bec

as
soon as i run a macro the form becomes invisible) it is
not deactivating the form even if its not in focus and

so
it never reduces its height.
.

.

Reply
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
userform question [email protected] Excel Discussion (Misc queries) 0 May 29th 09 12:01 AM
Userform question Anthony Excel Worksheet Functions 4 June 27th 08 04:26 PM
Userform question Greg B Excel Discussion (Misc queries) 1 May 13th 05 01:06 PM
Userform Question Greg B Excel Discussion (Misc queries) 3 March 10th 05 10:46 AM
UserForm Question abxy[_16_] Excel Programming 2 February 5th 04 07:11 PM


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

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

About Us

"It's about Microsoft Excel"