+ Reply to Thread
Results 1 to 7 of 7

form size and protection

  1. #1
    Liedson31
    Guest

    form size and protection

    hi everyone, i need some help
    i have a form that i want to display on fullscreen independent of screen
    resolution(1024,800,....) i, want to show always on full screen...

    the second question is, in this form i don“t want the user rezise it or move
    it the form must be "locked" from any movement,the user only put values in
    the boxes available.....

    sorry about my english if it is not good

    thanks in advance
    Miguel


  2. #2
    Vasant Nanavati
    Guest

    Re: form size and protection

    Try something like this (put it in the UserForm's code module):

    Private Sub UserForm_Initialize()
    With Application
    Top = .Top
    Height = .Height
    Left = .Left
    Width = .Width
    End With
    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
    End Sub

    --

    Vasant



    "Liedson31" <[email protected]> wrote in message
    news:[email protected]...
    > hi everyone, i need some help
    > i have a form that i want to display on fullscreen independent of screen
    > resolution(1024,800,....) i, want to show always on full screen...
    >
    > the second question is, in this form i don“t want the user rezise it or

    move
    > it the form must be "locked" from any movement,the user only put values in
    > the boxes available.....
    >
    > sorry about my english if it is not good
    >
    > thanks in advance
    > Miguel
    >




  3. #3
    Liedson31
    Guest

    Re: form size and protection

    thanks vasant

    the with application... works fine but after the end with part,the
    FindWindowA my excel donĀ“t recognize it,gives me a "sub or function not
    defined".it is a reference that i must insert? if it works what do the lines :
    For lCount = 1 To 6
    DeleteMenu GetSystemMenu(lHandle, False), 0, MF_BYPOSITION
    Next lCount

    thanks again for your help
    Miguel


    > Try something like this (put it in the UserForm's code module):
    >
    > Private Sub UserForm_Initialize()
    > With Application
    > Top = .Top
    > Height = .Height
    > Left = .Left
    > Width = .Width
    > End With
    > 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
    > End Sub
    >
    > --
    >
    > Vasant
    >
    >
    >
    > "Liedson31" <[email protected]> wrote in message
    > news:[email protected]...
    > > hi everyone, i need some help
    > > i have a form that i want to display on fullscreen independent of screen
    > > resolution(1024,800,....) i, want to show always on full screen...
    > >
    > > the second question is, in this form i donĀ“t want the user rezise it or

    > move
    > > it the form must be "locked" from any movement,the user only put values in
    > > the boxes available.....
    > >
    > > sorry about my english if it is not good
    > >
    > > thanks in advance
    > > Miguel
    > >

    >
    >
    >


  4. #4
    Vasant Nanavati
    Guest

    Re: form size and protection

    I apologize; I forgot the declarations. Paste the following at the top of
    your module:

    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

    --

    Vasant

    "Liedson31" <[email protected]> wrote in message
    news:[email protected]...
    > thanks vasant
    >
    > the with application... works fine but after the end with part,the
    > FindWindowA my excel don“t recognize it,gives me a "sub or function not
    > defined".it is a reference that i must insert? if it works what do the

    lines :
    > For lCount = 1 To 6
    > DeleteMenu GetSystemMenu(lHandle, False), 0, MF_BYPOSITION
    > Next lCount
    >
    > thanks again for your help
    > Miguel
    >
    >
    > > Try something like this (put it in the UserForm's code module):
    > >
    > > Private Sub UserForm_Initialize()
    > > With Application
    > > Top = .Top
    > > Height = .Height
    > > Left = .Left
    > > Width = .Width
    > > End With
    > > 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
    > > End Sub
    > >
    > > --
    > >
    > > Vasant
    > >
    > >
    > >
    > > "Liedson31" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > hi everyone, i need some help
    > > > i have a form that i want to display on fullscreen independent of

    screen
    > > > resolution(1024,800,....) i, want to show always on full screen...
    > > >
    > > > the second question is, in this form i don“t want the user rezise it

    or
    > > move
    > > > it the form must be "locked" from any movement,the user only put

    values in
    > > > the boxes available.....
    > > >
    > > > sorry about my english if it is not good
    > > >
    > > > thanks in advance
    > > > Miguel
    > > >

    > >
    > >
    > >




  5. #5
    Liedson31
    Guest

    Re: form size and protection

    Sorry the time i took to reply.....but i've been "captured" by my boss for
    another application and i put this one back....but once iĀ“ve started it
    again...i remember my earlier problem ))))))

    it works perfectly!!!

    Thanks very much
    Miguel

    "Vasant Nanavati" wrote:

    > I apologize; I forgot the declarations. Paste the following at the top of
    > your module:
    >
    > 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
    >
    > --
    >
    > Vasant
    >
    > "Liedson31" <[email protected]> wrote in message
    > news:[email protected]...
    > > thanks vasant
    > >
    > > the with application... works fine but after the end with part,the
    > > FindWindowA my excel donĀ“t recognize it,gives me a "sub or function not
    > > defined".it is a reference that i must insert? if it works what do the

    > lines :
    > > For lCount = 1 To 6
    > > DeleteMenu GetSystemMenu(lHandle, False), 0, MF_BYPOSITION
    > > Next lCount
    > >
    > > thanks again for your help
    > > Miguel
    > >
    > >
    > > > Try something like this (put it in the UserForm's code module):
    > > >
    > > > Private Sub UserForm_Initialize()
    > > > With Application
    > > > Top = .Top
    > > > Height = .Height
    > > > Left = .Left
    > > > Width = .Width
    > > > End With
    > > > 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
    > > > End Sub
    > > >
    > > > --
    > > >
    > > > Vasant
    > > >
    > > >
    > > >
    > > > "Liedson31" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > hi everyone, i need some help
    > > > > i have a form that i want to display on fullscreen independent of

    > screen
    > > > > resolution(1024,800,....) i, want to show always on full screen...
    > > > >
    > > > > the second question is, in this form i donĀ“t want the user rezise it

    > or
    > > > move
    > > > > it the form must be "locked" from any movement,the user only put

    > values in
    > > > > the boxes available.....
    > > > >
    > > > > sorry about my english if it is not good
    > > > >
    > > > > thanks in advance
    > > > > Miguel
    > > > >
    > > >
    > > >
    > > >

    >
    >
    >


  6. #6
    Vasant Nanavati
    Guest

    Re: form size and protection

    Thanks for the feedback!

    --

    Vasant

    "Liedson31" <[email protected]> wrote in message
    news:[email protected]...
    > Sorry the time i took to reply.....but i've been "captured" by my boss for
    > another application and i put this one back....but once i“ve started it
    > again...i remember my earlier problem ))))))
    >
    > it works perfectly!!!
    >
    > Thanks very much
    > Miguel
    >
    > "Vasant Nanavati" wrote:
    >
    > > I apologize; I forgot the declarations. Paste the following at the top

    of
    > > your module:
    > >
    > > 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
    > >
    > > --
    > >
    > > Vasant
    > >
    > > "Liedson31" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > thanks vasant
    > > >
    > > > the with application... works fine but after the end with part,the
    > > > FindWindowA my excel don“t recognize it,gives me a "sub or function

    not
    > > > defined".it is a reference that i must insert? if it works what do the

    > > lines :
    > > > For lCount = 1 To 6
    > > > DeleteMenu GetSystemMenu(lHandle, False), 0,

    MF_BYPOSITION
    > > > Next lCount
    > > >
    > > > thanks again for your help
    > > > Miguel
    > > >
    > > >
    > > > > Try something like this (put it in the UserForm's code module):
    > > > >
    > > > > Private Sub UserForm_Initialize()
    > > > > With Application
    > > > > Top = .Top
    > > > > Height = .Height
    > > > > Left = .Left
    > > > > Width = .Width
    > > > > End With
    > > > > 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
    > > > > End Sub
    > > > >
    > > > > --
    > > > >
    > > > > Vasant
    > > > >
    > > > >
    > > > >
    > > > > "Liedson31" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > hi everyone, i need some help
    > > > > > i have a form that i want to display on fullscreen independent of

    > > screen
    > > > > > resolution(1024,800,....) i, want to show always on full screen...
    > > > > >
    > > > > > the second question is, in this form i don“t want the user rezise

    it
    > > or
    > > > > move
    > > > > > it the form must be "locked" from any movement,the user only put

    > > values in
    > > > > > the boxes available.....
    > > > > >
    > > > > > sorry about my english if it is not good
    > > > > >
    > > > > > thanks in advance
    > > > > > Miguel
    > > > > >
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




  7. #7
    Liedson31
    Guest

    Re: form size and protection

    Hi again Vasant......
    After all my problem is bigger!

    the code you give me works fine like a told you yesterday,but i have another
    problem:

    my form is optimized to 1024x768,in this resolution she really display on
    fullscreen,centered and works perfectly,but....2 situations:

    1-if the resolution changes to 1280x... or higher the form works fine but
    the only change i need to made is that the form isnĀ“t centered...i already
    have the form set in Startupposition - CenterScreen(Owner - i tried both),
    but what really happen is that in the screen it increases the backcolor of
    the form to the right and the form goes to the left ??? the increase of the
    back color is no problem but the form menu goes to the left......it donĀ“t
    like it its possible to have it centered?

    2-this one i believe is even more dificult....and if the user uses a 800x600
    resolution..he can even see the whole form ))

    thanks again
    Miguel

    "Vasant Nanavati" wrote:

    > Thanks for the feedback!
    >
    > --
    >
    > Vasant
    >
    > "Liedson31" <[email protected]> wrote in message
    > news:[email protected]...
    > > Sorry the time i took to reply.....but i've been "captured" by my boss for
    > > another application and i put this one back....but once iĀ“ve started it
    > > again...i remember my earlier problem ))))))
    > >
    > > it works perfectly!!!
    > >
    > > Thanks very much
    > > Miguel
    > >
    > > "Vasant Nanavati" wrote:
    > >
    > > > I apologize; I forgot the declarations. Paste the following at the top

    > of
    > > > your module:
    > > >
    > > > 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
    > > >
    > > > --
    > > >
    > > > Vasant
    > > >
    > > > "Liedson31" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > thanks vasant
    > > > >
    > > > > the with application... works fine but after the end with part,the
    > > > > FindWindowA my excel donĀ“t recognize it,gives me a "sub or function

    > not
    > > > > defined".it is a reference that i must insert? if it works what do the
    > > > lines :
    > > > > For lCount = 1 To 6
    > > > > DeleteMenu GetSystemMenu(lHandle, False), 0,

    > MF_BYPOSITION
    > > > > Next lCount
    > > > >
    > > > > thanks again for your help
    > > > > Miguel
    > > > >
    > > > >
    > > > > > Try something like this (put it in the UserForm's code module):
    > > > > >
    > > > > > Private Sub UserForm_Initialize()
    > > > > > With Application
    > > > > > Top = .Top
    > > > > > Height = .Height
    > > > > > Left = .Left
    > > > > > Width = .Width
    > > > > > End With
    > > > > > 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
    > > > > > End Sub
    > > > > >
    > > > > > --
    > > > > >
    > > > > > Vasant
    > > > > >
    > > > > >
    > > > > >
    > > > > > "Liedson31" <[email protected]> wrote in message
    > > > > > news:[email protected]...
    > > > > > > hi everyone, i need some help
    > > > > > > i have a form that i want to display on fullscreen independent of
    > > > screen
    > > > > > > resolution(1024,800,....) i, want to show always on full screen...
    > > > > > >
    > > > > > > the second question is, in this form i donĀ“t want the user rezise

    > it
    > > > or
    > > > > > move
    > > > > > > it the form must be "locked" from any movement,the user only put
    > > > values in
    > > > > > > the boxes available.....
    > > > > > >
    > > > > > > sorry about my english if it is not good
    > > > > > >
    > > > > > > thanks in advance
    > > > > > > Miguel
    > > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > >
    > > >
    > > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1