Results 1 to 3 of 3

Thread: Toggling a form to full screen view

  1. #1
    Guest

    Post

    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

  2. #2
    Lively Member
    Join Date
    Jan 1999
    Posts
    82

    Post

    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


  3. #3
    Guest

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width