Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If you've changed a Forms Height, Top etc. is there any way to restore the design time defaults, without closing the Form and opening it again? Specifically I'm trying to force it back to center (StartupPosition = 1, Form Top = 0) after it's expanded, then shrunk again. Thanks - Kirk |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With APIs you can work out the pixel size of the screen and the form and
center accordingly. However for your needs probably OK to simply trap and restore its coordinates ' click the form Private mLt As Single, mTp As Single Private Sub UserForm_Activate() With Me mLt = .Left mTp = Top End With End Sub Private Sub UserForm_Click() Static b As Boolean With Me .Left = IIf(b, mLt, 20) .Top = IIf(b, mTp, 20) End With b = Not b End Sub Regards, Peter T <kirkm wrote in message ... If you've changed a Forms Height, Top etc. is there any way to restore the design time defaults, without closing the Form and opening it again? Specifically I'm trying to force it back to center (StartupPosition = 1, Form Top = 0) after it's expanded, then shrunk again. Thanks - Kirk |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Check out 'Chip Pearson's' (http://www.cpearson.com/excel/FormPosition.htm) solution. -- royUK Hope that helps, RoyUK For tips & examples visit my 'web site' (http://www.excel-it.com/) ------------------------------------------------------------------------ royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=101864 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or, store the values when the form is first opened, do whatever you want
with the form, then reset using the stored values. -- Regards, Tim Zych http://www.higherdata.com Workbook Compare - Excel data comparison utility <kirkm wrote in message ... If you've changed a Forms Height, Top etc. is there any way to restore the design time defaults, without closing the Form and opening it again? Specifically I'm trying to force it back to center (StartupPosition = 1, Form Top = 0) after it's expanded, then shrunk again. Thanks - Kirk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I have some code which loads a form in Excel on startup | Excel Programming | |||
How do I create startup boxes that once answered appear in a form | Excel Worksheet Functions | |||
Custom User Form At Startup | Excel Discussion (Misc queries) | |||
Loading Form on Startup II | Excel Programming | |||
Displaying form on startup? | Excel Programming |