ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change Form Size after Click (https://www.excelbanter.com/excel-programming/310988-change-form-size-after-click.html)

Huyeote[_4_]

Change Form Size after Click
 

I have a modeless form in a XL workbook to enable user to list record
in a worksheet matching some criteria in a list box in a form. Sinc
the form is a bit big, I want to reduce the form size and hide othe
controls to show only the list box after user double clicks a record i
the list box (to show more space of the worksheet)? Can anyone show m
how to do this or direct me to some sample worbook to learn? Thanks!

Regards,

Huyeot

--
Huyeot
-----------------------------------------------------------------------
Huyeote's Profile: http://www.excelforum.com/member.php...fo&userid=1389
View this thread: http://www.excelforum.com/showthread.php?threadid=26268


rog

Change Form Size after Click
 
You should easily be able to adapt this :

Private Sub lstBox1_DblClick(ByVal Cancel As
MSForms.ReturnBoolean)

Const EXTRA As Integer = 30

Me.Height = lstBox1.Height + lstBox1.Top + EXTRA
Me.Width = lstBox1.Width + lstBox1.Left + EXTRA

End Sub

Private Sub UserForm_Initialize()
Dim i As Integer

For i = 65 To 80

lstBox1.AddItem Chr$(i)

Next
End Sub


Regards

Rog




-----Original Message-----

I have a modeless form in a XL workbook to enable user to

list records
in a worksheet matching some criteria in a list box in a

form. Since
the form is a bit big, I want to reduce the form size and

hide other
controls to show only the list box after user double

clicks a record in
the list box (to show more space of the worksheet)? Can

anyone show me
how to do this or direct me to some sample worbook to

learn? Thanks!

Regards,

Huyeote


--
Huyeote
----------------------------------------------------------

--------------
Huyeote's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=13894
View this thread:

http://www.excelforum.com/showthread...hreadid=262686

.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com