Click to See Complete Forum and Search --> : Toggling a form to full screen view
I have a small freeform database program with two forms. One contains a treeview control and the other contains a textbox. They are separated by a splitter bar.
I would like to add code so that I can toggle the textbox to a full screen view.
I am relatively new to VB programing and have gained most of my knowledge through this forum.
Can anyone please help me?
Many thanks!!!!!!
jaxon
preeti
Jul 14th, 1999, 11:32 AM
Hi,
The only way that I know how to do this is in the keydown event of the textbox choose the key that you want for toggling the resizing of the form and check what size the form is then make it the other size:
'Using ESC Key
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then
If Width = Screen.Width Then
Height = Screen.Height
Width = Screen.Height
Else
Height=Original Height
Width=Original Width
End If
End If
End Sub
Replace Original Width and Original Height with the values of the smaller Height.
One way to place it back in the original poistion (beside the other form next to the splitter bar)
If they are split vertically:
Height=OtherFormName.Height
Width=Screen.Width-OtherFormName.Width-SplitterBar.Width.
If they are split horizantally:
Width=OtherFormName.Width
Height=Screen.Height-OtherFormName.Height-SplitterBar.Height
If you want the form to toggle at any time, place the code in the TreeView KeyDown event as well and replace Height with ThisFormName.Height and
ThisFormName.Width
ThisFormName is the form with the textbox
HTH,
Preeti
Thanks Preeti!
I just returned from a family vacation at the beach. Got your reply today and will work on it soon. I will let you know how it went. Thanks again!
jaxon
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.