Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default form in fullscreen v.s Screen resolution

hello everyone....
i tried some things to make this works but the most close i got was this
one(Vasant code). But i have 2 questions for this one:
- it works perfectly in 1024x768!but if i change the screen resolution to
1280x768 the form shows in fullscreen but isn´t centered,it goes to the left
and the right is fill with the backcolor.i already have the form in the
StarupPosition = CenterScreen.Have i any way to put the form centered?

- the second one is more dificult(i suppose)...and if i change the
resolution to 800x600, the user can´t even see all the objects in the form..

can anyone help me please

thanks in advance
Miguel

Private Declare Function FindWindow& _
Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName$, ByVal lpWindowName$)

Private Declare Function SetWindowLong& _
Lib "user32" Alias "SetWindowLongA" _
(ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)

Private Declare Function DrawMenuBar& _
Lib "user32" (ByVal hWnd&)

Private Const MF_BYPOSITION As Long = &H400

Private Declare Function GetSystemMenu Lib "user32" _
(ByVal hWnd As Long, ByVal bRevert As Long) As Long

Private Declare Function DeleteMenu Lib "user32" _
(ByVal hMenu As Long, ByVal nPosition As Long, _
ByVal wFlags As Long) As Long

Private Declare Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, ByVal lpWindowName _
As String) As Long


Application.DisplayFullScreen = True
With Application
Top = .Top
Height = .Height
Left = .Left
Width = .Width
End With

Dim hWnd As Long
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84080080
DrawMenuBar hWnd

Dim lHandle As Long, lCount As Long
On Error Resume Next
lHandle = FindWindowA(vbNullString, Me.Caption)
If lHandle < 0 Then
For lCount = 1 To 6
DeleteMenu GetSystemMenu(lHandle, False), 0, MF_BYPOSITION
Next lCount
End If
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
Screen Resolution Ronbo Excel Programming 2 January 17th 05 08:45 PM
Screen Resolution Sheldon Excel Programming 1 November 2nd 04 05:52 PM
Form resize based on screen resolution. Jim Rech Excel Programming 0 April 6th 04 07:03 PM
Screen resolution Arkimediz Excel Programming 3 April 1st 04 05:23 PM


All times are GMT +1. The time now is 06:54 PM.

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

About Us

"It's about Microsoft Excel"