Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default resize userform image to fit on any monitor


I wrote a macro that allows the user to load in an image from a a fil
and then displays that image in a userform. I need the entire image t
be displayed on the monitor regardless of the screen resolution
However, if the original image is larger than the screen resolution
only part of the image is displayed. Of course, one could scroll dow
to see the rest of the image, but this is unacceptable. I realize tha
I can determine the screen resolution of any monitor on which the macr
is used, and I know that I could resize the userform so that the whol
userform is visible regardless of the resolution. The question is, ho
can I resize the original image so that the entire picture will displa
in the userform at any resolution? I don't want the users to have t
resize the image in a different program before opening it in Excel

--
timspie
-----------------------------------------------------------------------
timspier's Profile: http://www.excelforum.com/member.php...fo&userid=3209
View this thread: http://www.excelforum.com/showthread.php?threadid=56856

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default resize userform image to fit on any monitor

Hi Tim,

You can attach picture to ur userform and strecth it.
and u can use API call to do this:
in your userform module:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam
As Any) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Const SC_MAXIMIZE = &HF030&
Const WM_SYSCOMMAND = &H112
Private Sub UserForm_Activate()
dim FrmhWnd as long
FrmhWnd = FindWindow(vbnullstring,me.caption)
SendMessage FrmhWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0
End sub

Thanks,

HAlim


timspier menuliskan:
I wrote a macro that allows the user to load in an image from a a file
and then displays that image in a userform. I need the entire image to
be displayed on the monitor regardless of the screen resolution.
However, if the original image is larger than the screen resolution,
only part of the image is displayed. Of course, one could scroll down
to see the rest of the image, but this is unacceptable. I realize that
I can determine the screen resolution of any monitor on which the macro
is used, and I know that I could resize the userform so that the whole
userform is visible regardless of the resolution. The question is, how
can I resize the original image so that the entire picture will display
in the userform at any resolution? I don't want the users to have to
resize the image in a different program before opening it in Excel.


--
timspier
------------------------------------------------------------------------
timspier's Profile: http://www.excelforum.com/member.php...o&userid=32090
View this thread: http://www.excelforum.com/showthread...hreadid=568562


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't select, move or resize an image in Excel?? Michael Howes Excel Discussion (Misc queries) 3 April 2nd 23 07:40 PM
Resize image using macro Gotroots Excel Worksheet Functions 1 November 12th 09 11:04 PM
auto resize when insert large image to excel sajid Excel Worksheet Functions 4 November 21st 06 03:40 PM
resize my userform MD Excel Programming 8 May 14th 05 03:16 PM
How to Resize Userform? hce[_25_] Excel Programming 5 October 24th 04 12:12 PM


All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"