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

Hello Group

What I would like to know - is there a way to automatically resize a
userform, or do I need to create lots of userforms to workround. For
instance, I have controls that are set visible=false inside a frame but
obviously when the userform first shows there is an awful lot of grey for
the user, "looks=tacky!"

Thanks as always in advance to this excellent group.
Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform resizing

Userforms have height and width properties. Your controls can be "off the
sheet" so to speak, and to make them visible increase the height or width
(or both ) to include them.

--
Regards,
Tom Ogilvy

"lmarks" wrote in message
...
Hello Group

What I would like to know - is there a way to automatically resize a
userform, or do I need to create lots of userforms to workround. For
instance, I have controls that are set visible=false inside a frame but
obviously when the userform first shows there is an awful lot of grey for
the user, "looks=tacky!"

Thanks as always in advance to this excellent group.
Mark




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Userform resizing

So what your saying then is when a control is activated I can resize the
userform so that the "New" controls are visible? Do you have a sample
of code so I can see how to incorperate it? For instance would I use
the userform activate control or attach it to a form control?

Thanks for the swift response
Mark



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform resizing

All my controls are visible (the ones "off the form" will not be seen).

When the form shows, I want the area just down to Label1 visible, so I do
this in the initialize event. The + 21 accounts for the blue caption.
When I press CommandButton5, then the form expands down to show additional
controls. Commandbutton4 is at the bottom of the display, so I use it to
determine the new size.

Private Sub UserForm_Initialize()
UserForm1.Height = Label1.Top + _
Label1.Height + 5 + 21
End Sub
Private Sub CommandButton4_Click()
Me.Hide
End Sub

Private Sub CommandButton5_Click()
UserForm1.Height = CommandButton4.Top + _
CommandButton4.Height + 5 + 21
End Sub


--
Regards,
Tom Ogilvy

"mark leslie" wrote in message
...
So what your saying then is when a control is activated I can resize the
userform so that the "New" controls are visible? Do you have a sample
of code so I can see how to incorperate it? For instance would I use
the userform activate control or attach it to a form control?

Thanks for the swift response
Mark



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Userform resizing

Many thanks

will give it a go

mark



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Userform resizing

That works really well thanks for taking the time to share.

Mark

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Resizing Comments Julie Echo Excel Discussion (Misc queries) 4 April 10th 07 09:32 AM
Resizing many charts Hosley Charts and Charting in Excel 5 November 21st 06 08:39 AM
Resizing cells in a selection without resizing entire sheet Danielle via OfficeKB.com Excel Discussion (Misc queries) 4 August 11th 06 10:06 PM
Resizing columns Jill Leyland Excel Discussion (Misc queries) 1 January 27th 05 03:59 PM
Resizing Ranges Chip Pearson Excel Programming 1 August 13th 03 03:56 PM


All times are GMT +1. The time now is 02:08 PM.

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"