Results 1 to 3 of 3

Thread: How to align or paint a picture at the top right corner of a form???

  1. #1

    Thread Starter
    Hyperactive Member toughcoder's Avatar
    Join Date
    Nov 2002
    Location
    Near, Very Near
    Posts
    340

    How to align or paint a picture at the top right corner of a form???

    hello every1, this problem of mine has been irritating me for a long time. I have a form on which is a imagelist containing one single image(a bitmap). I want the image to be perfectly aligned with the top right corner of the form. So the most probable logic will be the following i suppose

    Private Sub Command1_Click()
    Me.PaintPicture ImageList1.ListImages(1).Picture, Me.Width - ImageList1.ListImages(1).Picture.Width, 0
    End Sub

    so if the form width is say 1000 and the picture width is 100, then 1000-100=900, thats where the picture must be painted allowing it to to be perfectly aligned with the top right corner of the form. But this is not the case. The picture is being painted atleast a thousand pixel away from the place. Whats the problem. Plz try this code and provide me with a solution.
    If Not VB Then Exit
    ------------------------------------------------
    visit me @ http://mzubair.50g.com/

  2. #2
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    try setting both the forms and the pictures ScaleMode to 3
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  3. #3
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    and then use ScaleWidth, not Width
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

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