#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default forms

hi again....
i´ve already try this one but.....no replys...so here it is again:

i tried some things to make this works but the most close i got was this
one(Vasant gives me the 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

the code i have:

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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default forms

Hi Miguel



To the 800-600 question: You must either compact your information to fit in
800-600 (use tabstrips, multipages, whatever), or write code that
resize/reposition everything to fit into the user's full screen. But why not
use a 800-600 form in all screen resolutions ? What you are doing is
hijacking the user's computer screen, no matter how big it is, you hide the
other things I am working on. There is a reason to have a high screen
resolution; to see many things at the same time. I would probably
ctrl-alt-delete your application away if you displayed a 1280-768 form
containing 800-600 worth of information. So don't do this -my 0.02 only.

HTH. Best wishes Harald

"Liedson31" skrev i melding
...
hi again....
i´ve already try this one but.....no replys...so here it is again:

i tried some things to make this works but the most close i got was this
one(Vasant gives me the 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

the code i have:

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






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default forms

Thanks Harald....
Lets say..i change the form to 800x600, once you run in your computer
imagine you have 1024x768 resolution how can i display the form in fullscreen
and centered?

In my work most of the people who gona use this application have 1024*768
resolution,but now they are changing the monitors and many of them change it
to 1280*768 so the only thing i need to do is center the form,i already
display it in fullscreen but the form goes to the left of the screen.....

cheers
Miguel



"Harald Staff" wrote:

Hi Miguel



To the 800-600 question: You must either compact your information to fit in
800-600 (use tabstrips, multipages, whatever), or write code that
resize/reposition everything to fit into the user's full screen. But why not
use a 800-600 form in all screen resolutions ? What you are doing is
hijacking the user's computer screen, no matter how big it is, you hide the
other things I am working on. There is a reason to have a high screen
resolution; to see many things at the same time. I would probably
ctrl-alt-delete your application away if you displayed a 1280-768 form
containing 800-600 worth of information. So don't do this -my 0.02 only.

HTH. Best wishes Harald

"Liedson31" skrev i melding
...
hi again....
i´ve already try this one but.....no replys...so here it is again:

i tried some things to make this works but the most close i got was this
one(Vasant gives me the 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

the code i have:

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







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default forms

"Liedson31" skrev i melding
...
Thanks Harald....
Lets say..i change the form to 800x600, once you run in your computer
imagine you have 1024x768 resolution how can i display the form in

fullscreen
and centered?


You don't get my point. I'll try again:
Why would you want to do that ? And why should us users tolerate it
happening ? Your application is about to liberate humainty at my click of a
CommandButton1, or what else extremely top priority ?

HTH. Best wishes Harald


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
Forms Legallisa New Users to Excel 6 September 20th 07 11:28 PM
RefEdits and normal forms / forms in a DLL David Welch Excel Programming 0 December 1st 04 03:49 PM
Forms that open from forms Azza Excel Programming 1 October 12th 04 10:54 PM
Calling Forms from Forms - Exit problems Stuart[_5_] Excel Programming 3 May 25th 04 06:50 AM
VBA forms George V Excel Programming 1 September 8th 03 10:35 PM


All times are GMT +1. The time now is 11:14 AM.

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"