Results 1 to 6 of 6

Thread: Remembering size

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448

    Remembering size

    how would i make the form remember the size it was when it last openend?

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    text file or registry!

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I'd through my vote in for registry. You can use VB's built in SaveSetting() and GetSetting() functions, or find some better registry code on the net somewhere. Or I can give you some if you want it.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i think it would be easyer if you could give me some but explane it a lil so then i can understand it thanks

  5. #5
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    If you just want to use the built in vb functions then:

    VB Code:
    1. Private Sub Form_Load()
    2.   Me.Width = GetSetting("MyApp", "General", "Width", Me.Width)
    3.   Me.Height = GetSetting("MyApp", "General", "Height", Me.Height)
    4. End Sub
    5.  
    6. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    7.   SaveSetting "MyApp", "General", "Width", Me.Width
    8.   SaveSetting "MyApp", "General", "Height", Me.Height
    9. End Sub

    The syntax for the functions look like this:

    SaveSetting AppName, Section, Key, Value
    GetSetting AppName, Section, Key, [Defualt Value]
    Hope this helps.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    ok thanks that helps

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