Results 1 to 3 of 3

Thread: PictureBox

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Posts
    42

    Question

    I want to reposition a picture within a picturebox so that I can either print it so it has a 1/2 inch border or so that I can put a "frame" around it. What are the steps I want to follow?

    Old Man
    Using VB6 Professional Ediion

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Lightbulb

    If you want to position the form to the center of the
    screen at runtime you can insert this small block of
    code into your form's load event. This can be done faster and alot easier with the form's startupposition property
    but i like to code it myself. As for centering a picture
    or image within a picture box. Just place the image inside of the picture box then with the picture box's sizing handles enclose the image. Do the same with the form and you should have a border around the image.

    Private Sub Form_Load()
    Me.Top = (Screen.Height - Me.Height) / 2
    Me.Left = (Screen.Width - Me.Width) / 2
    End Sub

    If you want to add a nice dithering effect to the form
    create a standard module (go up to project and then add
    module) and put this code in it. In the form that you wish
    to dither just place a call to the dither module within the form load event. ie.....Dither Me


    '***********************************************************
    ' A short procedure to give forms a nice teal shading.
    '
    Public Sub Dither(frm As Form)
    Dim intLoop As Integer

    ' Set the pen parameters
    frm.DrawStyle = vbInsideSolid
    frm.DrawMode = vbCopyPen
    frm.ScaleMode = vbPixels
    frm.DrawWidth = 8
    frm.ScaleWidth = 176
    For intLoop = 0 To 175
    frm.Line (intLoop, 0)-(intLoop - 1, Screen.Height), RGB(0, intLoop, intLoop), B
    Next intLoop
    End Sub




  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2000
    Posts
    42

    Talking Thanks...

    Thanks for your answer, but, I really wanted to reposistion at runtime.
    Using VB6 Professional Ediion

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