Setting the window size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Fox

    Setting the window size


    Dear All,

    How do I set the size of the window that is showing the database forms?

    can't find any helps on it.


    John Fox
  • GH

    #2
    Re: Setting the window size

    On Apr 19, 6:33 am, John Fox <altab...@bham. ac.ukwrote:
    Dear All,
    >
    How do I set the size of the window that is showing the database forms?
    >
    can't find any helps on it.
    >
    John Fox
    Are you talking about at design time? All you have to do is make sure
    the window is not maximized so you can view its normal size, then
    click and drag the edges of the window to resize. If you save the
    form after changing the size, this will stick. If the form border
    style is set to Sizable, the window can also be resized by clicking
    and dragging during runtime, but this change will not be stored the
    next time the window opens. If this is not what you are asking about,
    please provide more detail as to what you are trying to accomplish.

    - GH

    Comment

    • John Fox

      #3
      Re: Setting the window size

      Dear GH,

      It's about the window size and shape at run time. I want to have a set
      size for the window.
      Have tried all the design time settings but they don't seem to
      make any difference.
      The borders of the window can always be moved.


      John


      On Apr 19, 6:33 am, John Fox <altab...@bham. ac.ukwrote:
      >Dear All,
      >>
      >How do I set the size of the window that is showing the database forms?
      >>
      >can't find any helps on it.
      >>
      >John Fox
      >
      Are you talking about at design time? All you have to do is make sure
      the window is not maximized so you can view its normal size, then
      click and drag the edges of the window to resize. If you save the
      form after changing the size, this will stick. If the form border
      style is set to Sizable, the window can also be resized by clicking
      and dragging during runtime, but this change will not be stored the
      next time the window opens. If this is not what you are asking about,
      please provide more detail as to what you are trying to accomplish.
      >
      - GH
      >

      Comment

      • GH

        #4
        Re: Setting the window size

        On Apr 19, 11:15 am, John Fox <altab...@bham. ac.ukwrote:
        Dear GH,
        >
        It's about the window size and shape at run time. I want to have a set
        size for the window.
        Have tried all the design time settings but they don't seem to
        make any difference.
        The borders of the window can always be moved.
        >
        John
        >
        If you set your window size correctly at design time then change the
        border type to any choice other than Sizable and save the form, your
        settings will stick and the user will not be able to change your
        settings at runtime. This is the only way to set the window size,
        because once you hit runtime control of the window is given to the end
        user not the program. All you can do is try to limit what the user
        can do at runtime.

        - GH

        Comment

        • tobesurveyor via AccessMonster.com

          #5
          Re: Setting the window size

          You can also set your OnOpen Event to
          DoCmd.MoveSize (# * 1440), (# * 1440), (# * 1440), (# * 1440)

          # = dimension of the size and position of the window.



          GH wrote:
          >Dear GH,
          >>
          >[quoted text clipped - 5 lines]
          >>
          >John
          >
          >If you set your window size correctly at design time then change the
          >border type to any choice other than Sizable and save the form, your
          >settings will stick and the user will not be able to change your
          >settings at runtime. This is the only way to set the window size,
          >because once you hit runtime control of the window is given to the end
          >user not the program. All you can do is try to limit what the user
          >can do at runtime.
          >
          >- GH
          --
          Message posted via AccessMonster.c om


          Comment

          • UrbanSpaceman

            #6
            Re: Setting the window size

            Here's what I use. Paste the following code into a standard module, then
            type:
            SizeAccess 640, 480
            into the immediate window.

            HTH

            ''''''CODE START''''''
            Private Type Rect
            x1 As Long
            y1 As Long
            x2 As Long
            y2 As Long
            End Type
            '
            Private Declare Function GetDesktopWindo w Lib "user32" () As Long
            Private Declare Function GetWindowRect Lib "user32" _
            (ByVal hwnd As Long, r As Rect) As Long
            Private Declare Function IsZoomed Lib "user32" _
            (ByVal hwnd As Long) As Long
            Private Declare Function MoveWindow Lib "user32" _
            (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, _
            ByVal dx As Long, ByVal dy As Long, ByVal fRepaint As Long) As Long
            Private Declare Function ShowWindow Lib "user32" _
            (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

            Sub SizeAccess(ByVa l dx As Long, ByVal dy As Long)
            'Set size of Access and center on Desktop

            Const SW_RESTORE As Long = 9
            Dim h As Long
            Dim r As Rect
            '
            On Error Resume Next
            '
            h = Application.hWn dAccessApp
            'If maximised, restore
            If (IsZoomed(h)) Then ShowWindow h, SW_RESTORE
            '
            'Get available Desktop size
            GetWindowRect GetDesktopWindo w(), r
            If ((r.x2 - r.x1) - dx) < 0 Or ((r.y2 - r.y1) - dy) < 0 Then
            'Desktop smaller than requested size
            'so size to Desktop
            MoveWindow h, r.x1, r.y1, r.x2, r.y2, True
            Else
            'Adjust to requested size and center
            MoveWindow h, _
            r.x1 + ((r.x2 - r.x1) - dx) \ 2, _
            r.y1 + ((r.y2 - r.y1) - dy) \ 2, _
            dx, dy, True
            End If

            End Sub
            ''''''CODE END''''''

            "John Fox" <altabios@bham. ac.ukwrote in message
            news:f07gia$lhq $1@redhat2.bham .ac.uk...
            >
            Dear All,
            >
            How do I set the size of the window that is showing the database forms?
            >
            can't find any helps on it.
            >
            >
            John Fox

            Comment

            • John Fox

              #7
              Re: Setting the window size

              Thanks for the info, I seem to be able to set the size of the form
              but not the window that it's in.


              John Fox


              GH wrote:
              On Apr 19, 11:15 am, John Fox <altab...@bham. ac.ukwrote:
              >Dear GH,
              >>
              >It's about the window size and shape at run time. I want to have a set
              >size for the window.
              >Have tried all the design time settings but they don't seem to
              >make any difference.
              >The borders of the window can always be moved.
              >>
              >John
              >>
              >
              If you set your window size correctly at design time then change the
              border type to any choice other than Sizable and save the form, your
              settings will stick and the user will not be able to change your
              settings at runtime. This is the only way to set the window size,
              because once you hit runtime control of the window is given to the end
              user not the program. All you can do is try to limit what the user
              can do at runtime.
              >
              - GH
              >

              Comment

              • John Fox

                #8
                Re: Setting the window size


                I must have got something which is overriding this kind of command.
                Have tried the DoCmd.MoveSize command and the window stays the same
                position and size.

                I'm using Access 2003, is this the problem?
                Any ideas as to what is switching these commands off?

                Putting in break points has proved that the routines are being activated.


                John Fox


                tobesurveyor via AccessMonster.c om wrote:
                You can also set your OnOpen Event to
                DoCmd.MoveSize (# * 1440), (# * 1440), (# * 1440), (# * 1440)
                >
                # = dimension of the size and position of the window.
                >
                >
                >
                GH wrote:
                >>Dear GH,
                >>>
                >[quoted text clipped - 5 lines]
                >>John
                >If you set your window size correctly at design time then change the
                >border type to any choice other than Sizable and save the form, your
                >settings will stick and the user will not be able to change your
                >settings at runtime. This is the only way to set the window size,
                >because once you hit runtime control of the window is given to the end
                >user not the program. All you can do is try to limit what the user
                >can do at runtime.
                >>
                >- GH
                >

                Comment

                Working...