Results 1 to 5 of 5

Thread: [RESOLVED] need help

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    9

    Resolved [RESOLVED] need help

    Hi, i was wondering how i can put images and move them around and where ever i put them when i close the program that it saves it. Please tell me how i can do this thanks for your help
    andrew

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: need help

    Code:
    Option Explicit
    
    Private mPicX As Single
    Private mPicY As Single
    
    Private Sub Form_Load()
    
        Picture1.Left = CSng(GetSetting(App.EXEName, "Picture1 Position", "X", Picture1.Left))
        Picture1.Top = CSng(GetSetting(App.EXEName, "Picture1 Position", "Y", Picture1.Top))
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        SaveSetting App.EXEName, "Picture1 Position", "X", CStr(Picture1.Left)
        SaveSetting App.EXEName, "Picture1 Position", "Y", CStr(Picture1.Top)
    End Sub
    
    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        mPicX = X
        mPicY = Y
    End Sub
    
    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then
            Picture1.Left = Picture1.Left - (mPicX - X)
            Picture1.Top = Picture1.Top - (mPicY - Y)
        End If
    End Sub

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: need help

    Controls have a .Move method which can be used to resize & move them. Here is one solution from this site; you may want to search a bit more.

    To save the settings and read them back, a common approach is to use an INI file. Here is an example from this site
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    9

    Talking Re: need help

    Thanks so much for your help.

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: need help

    Now that we've helped you, you can help us by pulling down the Thread Tools menu and selecting the Mark Thread Resolved item which will let everyone know that you have your answer. Also if someone has been particularly helpful you have the ability to affect a their forum "reputation" by rating their post. (No need to do it for me.) Only those ratings that you give after you have 20 posts will actually count, but in all cases the person you rate will see it and know that you appreciate their help.

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