Userfom background picture size function

asyamonique

Well-known Member
Joined
Jan 29, 2008
Messages
1,280
Office Version
  1. 2013
Platform
  1. Windows
Hello,
I have a userform which Height"1080" , Width"1920" and with below code when its populated if I run the whole code, the background picture doesn't fit at the screen even though picture size is 1080*1920. The reason of that size is I'm going to use that userform at the big screen tv.
Is there any way to fix that problem.
Thanks


Code:
Private Sub UserForm_Initialize()

With Application
.WindowState = xlMaximized
'Zoom = Int(.Width / Me.Width * 100)
Width = .Width
Height = .Height
End With
End Sub
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
.
Here is on method :

Code:
Private Sub ToggleButton1_Click()
    
    If Me.ToggleButton1.Value = True Then
        Me.Height = 50
        Me.Width = 50
        Me.Top = 450
        Me.Left = 0
        Me.ToggleButton1.Left = 0
        Me.ToggleButton1.Top = 0
        Me.ToggleButton1.Caption = "Maximize"
    Else
        Me.Height = Application.Width
        Me.Width = Application.Width
        Me.Top = 0
        Me.Left = 0
        Me.ToggleButton1.Left = 900
        Me.ToggleButton1.Top = 6
        Me.ToggleButton1.Caption = "Minmize"
    End If


End Sub




Private Sub UserForm_Activate()




Application.WindowState = xlMaximized


Me.Height = Application.Height
Me.Width = Application.Width
Me.ToggleButton1.Left = 950




End Sub

Download sample workbook : https://drive.google.com/file/d/1lejxrnhEB9lUjJPUgCGvfVhnqZhM-hx-/view
 
Upvote 0
You can do that also. That way it will autorun when the form is opened.
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top