Solved

Image control inconsistent size

Posted on 2000-05-11
3
148 Views
Last Modified: 2010-05-02
I've got a form of set size/fixed borders. I have a number of bitmaps on the form in image controls. They all look hunky dory on my screen, but sometimes when the app is run elsewhere, the graphics are all shorter and narrower than they appear on my screen, which throws things off center and makes me look bad. :-(

I'm assuming this is a screen resolution issue. But I can't mandate the user's screen resolution. So I need to find another way around this.

The image controls each have the .Stretch set to false. Would resetting this to true do it? (I know. I could try it and see. But I don't have consistent access to any of the computers that I've seen it not work on, so I have to fix it without being able to verify that the fix works.)

Any input would be greatly appreciated. Thanks! -- b.r.t.
0
Comment
Question by:BarryTice
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
Ashron earned 50 total points
ID: 2801789
Hi BarryTice.
The answer is yes, setting the Stretch property of the Image control will resize it to the size of the image you load in it, but it won't resize the size of it's container ( frame, form, so on). Unfortunatly, this control doesn't provide the Resize Event. You can easyly figure a way to work around. For example, you could define the SetImage Function, who would load the image into the Control, and then resize its container. Another way you could do it is to use the PictureBox control, which provides the Resize Event. You would code the same in both procedure, but the last has the advantage of updating the size of it's container even if you access the control directly.

The code in the resize event would look like something like this :

private sub pic_Resize()
  ' The pic is in a form
  me.move me.left, me.top, pic.width + 200, pic.height + 200
end sub

Here I use the Move so there is only one Resize Message sent to the From. The 200 value is a random value out of my imagination. You'll have to test it to fit your need.

Hope this help

0
 
LVL 7

Author Comment

by:BarryTice
ID: 2801983
Ashron --

Thanks for the response, but I'm not sure what the resize event would have to do with this. I'm not attempting to resize the graphic, only to not have it appear smaller on some screens.

The graphics in the images are set at design time. They are never changed at run time. Therefore, resize doesn't come into play, that I understand.

Please clarify this, if you would be so kind.

-- b.r.t.


 
0
 
LVL 7

Author Comment

by:BarryTice
ID: 2810710
Well, I'm still not sure what you had intended with the resize events. But setting .Stretch to True did the trick, so I guess that's the answer. (I got access to one of the computers it has blown up on in the past to check it. Unfortunately, that requires kicking the coworker off long enough to do it, which meant she couldn't get any work done while I was testing. :-( )

So, for the long and short of it, I guess you gave me more information than I needed, and I can't fault you for that. Here's your "A" and your first 200 points.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now