Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Background Screen Setting
Message
 
To
12/01/2021 09:54:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01677804
Message ID:
01677806
Views:
45
Wjere is your checking for lcBgType = "CENTER"?
Also lcBgType is lowercase and you compare it with UPPER case words I thing all will go to the OTHERWISE part of DO CASE


>Howdy all,
>
>I am trying to setup a background screen image upon FP 9.0 application opening up (after succesful login). The code listed below works but when I run it on different monitor sizes, the image isn't centered on the monitor. Is there a way to ensure that regardless of which size the monitor is, the screen background image is centered on the monitor size?
>
>lcImage = "mainlogo_g.png"
>
>lcBgType = "center"
>
>IF NOT PEMSTATUS(_Screen, "oImg", 5)
> _Screen.AddObject("oImg", "Image")
>ENDIF
>
>WITH _Screen.oImg
> .Visible = .F.
> .Stretch = 0
> .Picture = lcImage
> DO CASE
> CASE lcBgType == "STRETCH"
> .Top = 0
> .Left = 0
> .Stretch = 2
> .Height = _Screen.Height
> .Width = _Screen.Width
> CASE lcBgType == "ISOMETRIC"
> .Stretch = 1
> .Height = _Screen.Height
> .Width = _Screen.Width
> .Top = (_Screen.Height - .Height) / 2
> .Left = (_Screen.Width - .Width) / 2
> CASE lcBgType == "CENTER"
> .Stretch = 0
> .Top = (_Screen.Height - .Height) / 2
> .Left = (_Screen.Width - .Width) / 2
>
> OTHERWISE
> .Top = 0
> .Left = 0
> .Stretch = 0
> ENDCASE
> .Visible = .T.
>
>endwithlcImage = "mainlogo_g.png"
>* Center Image
>*lcBgType = "CENTER"
>* Stretch image
>lcBgType = "center"
>
>IF NOT PEMSTATUS(_Screen, "oImg", 5)
> _Screen.AddObject("oImg", "Image")
>ENDIF
>
>WITH _Screen.oImg
> .Visible = .F.
> .Stretch = 0
> .Picture = lcImage
> DO CASE
> CASE lcBgType == "STRETCH"
> .Top = 0
> .Left = 0
> .Stretch = 2
> .Height = _Screen.Height
> .Width = _Screen.Width
> CASE lcBgType == "ISOMETRIC"
> .Stretch = 1
> .Height = _Screen.Height
> .Width = _Screen.Width
> .Top = (_Screen.Height - .Height) / 2
> .Left = (_Screen.Width - .Width) / 2
> CASE lcBgType == "CENTER"
> .Stretch = 0
> .Top = (_Screen.Height - .Height) / 2
> .Left = (_Screen.Width - .Width) / 2
>
> OTHERWISE
> .Top = 0
> .Left = 0
> .Stretch = 0
> ENDCASE
> .Visible = .T.
>
>endwith
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform