Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images and Maximize- Help badly needed!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
is there some form of ancher (anker- spelling?) command that allows you to place images in a area (such as topmost right)and keep them there so that they move with the form when the form is maximized? Or, if anyone can give me ideas on what to do about this: my program has a bunch of images, and i want the program to be able to be maximized. how do i make the images correctly resize with the form for the correct resolution when the form is maximized. please help, and comments or suggestions would be greatly appreciated. [sig][/sig]
 
Hi,

If you use the Picture control there is a [tt]Stretch[/tt] property, boolean.

Set [tt]Stretch[/tt] to true.

In your form resize event, set the [tt]Height[/tt], [tt]Width[/tt], [tt]Top[/tt] and [tt]Left[/tt] properties of the Picture control so that it grows and shrinks with the form.

You might want to think about preserving the aspect ratio of your image though (the relationship between the height and the width) unless you're ok with the image looking very strange indeed.
[sig][/sig]
 
like this:
[tt]
Private Sub Form_Resize()
Image1.Stretch = True
Image1.Height = Me.Height * 0.75
Image1.Width = Me.Width * 0.75
Image1.Left = Me.Width * 0.1
Image1.Top = Me.Height * 0.1
End Sub
[/tt]
[sig][/sig]
 
thanks, but it still doesnt work quite right. the picture that that code is set to starts up in the middle of the form, and at an enlarged size, not where i had placed it.... more help needed please [sig][/sig]
 
Yes -- the code I posted was just an example really, meant to illustrate how you can re-size something when a form resizes. The principle is still correct for what you'd like to do I think (as long as I've understood it mind you, and that's by no means certain)

You'd like the Picture to be always in the top right hand corner, is that right?

If you notice the code above it keeps the Picture control 3/4 the size of the container control (the form) and positions it 1/10th of the way down the form and 1/10th of the way across the form.

try this instead:
[tt]
Image1.Height = Me.Height * 0.25
Image1.Width = Me.Width * 0.25
Image1.Left = Me.Width * 0.5
Image1.Top = Me.Height * 0.5
[/tt]

By decreasing the first two and increasing the second two the Picture moves up and right.

How'm I doing? Am I understanding you correctly? [sig][/sig]
 
im kinda gettin it... what would be the numbers for the upper-right? [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top