Results 1 to 5 of 5

Thread: Creating a background for an MDI Client

  1. #1

    Thread Starter
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    I'm trying to get a background made for an MDI client. The problem I'm having is this. I've tried creating a form that is loaded when the MDI client is started, however, then this form also appears in my list of open child forms, and I don't want that to happen. Then I tried to put a Picture box in the MDI client, and then I could put an image control onto that, however, the problem with that is then the picture box covers up all the other child forms. I need to be able to resize and reposition the background picture, because it is going to be on machines with different resolutions. Does anyone have any suggestions for me, I'm really frustrated, and I am willing to try anything! Please help. Thanks.

    ------------------
    Ryan
    corneslen@hotmail.com
    ICQ# 47799046

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Post

    I wouldn't use a form for the picture, but an invisible picturebox. At the resize event of the mdi parent, you could do the resizing of the picture in the picturebox, and then set the mdi parents picture property equal to the image property of the picturebox. eg

    Private Sub MDIForm_Resize()
    ' do the resizing of the picture in the picturebox here
    '.....
    '.....
    MDIForm1.Picture = Picture1.Image
    End Sub

  3. #3

    Thread Starter
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    How would you resize a picture in a picture box? I thought you could only resize things in an image control?

    ------------------
    Ryan
    corneslen@hotmail.com
    ICQ# 47799046

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Post

    Using the StretchBlt api for instance. But if you want to use vb methods:

    Picture1.PaintPicture Picture1.Picture, 0, 0, Picture1.Width * 2, Picture1.Height * 2, 0, 0, Picture1.Width, Picture1.Height, vbSrcCopy
    Picture1.Picture = Picture1.Image

    will double the size of the picture in the picturebox

  5. #5

    Thread Starter
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    I'm really interested in using the Stretchblt API, but I need a little help with that. I'm confused as to how I would set the destination of the StretchBlt function to be the MDIMain.Picture??? Could you give me an example I can follow? Thanks.

    ------------------
    Ryan
    corneslen@hotmail.com
    ICQ# 47799046

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