?
Solved

Image control inconsistent size

Posted on 2000-05-11
3
Medium Priority
?
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
Ashron earned 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

743 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