+ Reply to Thread
Results 1 to 9 of 9

Screen updating

  1. #1
    StevenS
    Guest

    Screen updating

    I have a similar problem to Dennis. I am trying to get VB to set a scal for
    cells & shapes to suit the current users screen size. I run VB code to change
    the sizing of the shapes for the size shed the customer wants. I'm not sure
    of the code I need to do this.

    Please help
    --
    SS

  2. #2
    Tom Ogilvy
    Guest

    Re: Screen updating

    Shapes have a Height and Width property.

    for each shp in ActiceSheet.Shapes
    with shp
    .Height = 1.25 * .Height
    .Width = 1.37 * .Width
    End With
    Next

    these are also scalewidth and scaleheight properties

    Also look at the LockAspectRatio property.

    See help for details.

    --
    Regards,
    Tom Ogilvy


    "StevenS" <[email protected]> wrote in message
    news:[email protected]...
    > I have a similar problem to Dennis. I am trying to get VB to set a scal

    for
    > cells & shapes to suit the current users screen size. I run VB code to

    change
    > the sizing of the shapes for the size shed the customer wants. I'm not

    sure
    > of the code I need to do this.
    >
    > Please help
    > --
    > SS




  3. #3
    StevenS
    Guest

    Re: Screen updating

    Hi Tom. I have hard coded the top properties for my shapes, this is the
    problem. I have to get my programme to determine the new users monitor size
    and set new top properties for my shapes. I am not sure on how to get the new
    users monitor size and how to give new top values to the shapes.
    --
    SS


    "Tom Ogilvy" wrote:

    > Shapes have a Height and Width property.
    >
    > for each shp in ActiceSheet.Shapes
    > with shp
    > .Height = 1.25 * .Height
    > .Width = 1.37 * .Width
    > End With
    > Next
    >
    > these are also scalewidth and scaleheight properties
    >
    > Also look at the LockAspectRatio property.
    >
    > See help for details.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "StevenS" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have a similar problem to Dennis. I am trying to get VB to set a scal

    > for
    > > cells & shapes to suit the current users screen size. I run VB code to

    > change
    > > the sizing of the shapes for the size shed the customer wants. I'm not

    > sure
    > > of the code I need to do this.
    > >
    > > Please help
    > > --
    > > SS

    >
    >
    >


  4. #4
    Jim Thomlinson
    Guest

    Re: Screen updating

    Everything you wanted to know about monitors but were affraid to ask...

    Declare Function GetDeviceCaps Lib "Gdi32" _
    (ByVal hdc As Long, ByVal nIndex As Long) As Long
    Declare Function GetDC Lib "User32" _
    (ByVal hWnd As Long) As Long
    Declare Function ReleaseDC Lib "User32" _
    (ByVal hWnd As Long, ByVal hdc As Long) As Long

    Public Function HRes() As Integer
    'Returns the horizontal resolution in pixels
    Dim lDC As Long
    lDC = GetDC(0)
    HRes = GetDeviceCaps(lDC, 8)
    ReleaseDC 0, lDC
    End Function

    Public Function VRes() As Integer
    'Returns the vertical resolution in pixels
    Dim lDC As Long
    lDC = GetDC(0)
    VRes = GetDeviceCaps(lDC, 10)
    ReleaseDC 0, lDC
    End Function

    Public Function ColorDepth() As Integer
    'Returns the color depth in bits per pixel
    Dim lDC As Long
    lDC = GetDC(0)
    ColorDepth = GetDeviceCaps(lDC, 12) _
    * GetDeviceCaps(lDC, 14)
    ReleaseDC 0, lDC
    End Function

    Public Function Colors() As Single
    'Returns the number of available colors
    Dim lDC As Long
    lDC = GetDC(0)
    Colors = 2 ^ (GetDeviceCaps(lDC, 12) _
    * GetDeviceCaps(lDC, 14))
    ReleaseDC 0, lDC
    End Function

    Public Function VRefresh() As Integer
    'Returns the vertical refresh rate in Hz
    Dim lDC As Long
    lDC = GetDC(0)
    VRefresh = GetDeviceCaps(lDC, 116)
    ReleaseDC 0, lDC
    End Function

    --
    HTH...

    Jim Thomlinson


    "StevenS" wrote:

    > Hi Tom. I have hard coded the top properties for my shapes, this is the
    > problem. I have to get my programme to determine the new users monitor size
    > and set new top properties for my shapes. I am not sure on how to get the new
    > users monitor size and how to give new top values to the shapes.
    > --
    > SS
    >
    >
    > "Tom Ogilvy" wrote:
    >
    > > Shapes have a Height and Width property.
    > >
    > > for each shp in ActiceSheet.Shapes
    > > with shp
    > > .Height = 1.25 * .Height
    > > .Width = 1.37 * .Width
    > > End With
    > > Next
    > >
    > > these are also scalewidth and scaleheight properties
    > >
    > > Also look at the LockAspectRatio property.
    > >
    > > See help for details.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "StevenS" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I have a similar problem to Dennis. I am trying to get VB to set a scal

    > > for
    > > > cells & shapes to suit the current users screen size. I run VB code to

    > > change
    > > > the sizing of the shapes for the size shed the customer wants. I'm not

    > > sure
    > > > of the code I need to do this.
    > > >
    > > > Please help
    > > > --
    > > > SS

    > >
    > >
    > >


  5. #5
    StevenS
    Guest

    Re: Screen updating

    Excellent. Excuse my ignorace. Where should this information be placed. When
    my user opens the programme I want it to fit everything to the screen.
    --
    SS


    "Jim Thomlinson" wrote:

    > Everything you wanted to know about monitors but were affraid to ask...
    >
    > Declare Function GetDeviceCaps Lib "Gdi32" _
    > (ByVal hdc As Long, ByVal nIndex As Long) As Long
    > Declare Function GetDC Lib "User32" _
    > (ByVal hWnd As Long) As Long
    > Declare Function ReleaseDC Lib "User32" _
    > (ByVal hWnd As Long, ByVal hdc As Long) As Long
    >
    > Public Function HRes() As Integer
    > 'Returns the horizontal resolution in pixels
    > Dim lDC As Long
    > lDC = GetDC(0)
    > HRes = GetDeviceCaps(lDC, 8)
    > ReleaseDC 0, lDC
    > End Function
    >
    > Public Function VRes() As Integer
    > 'Returns the vertical resolution in pixels
    > Dim lDC As Long
    > lDC = GetDC(0)
    > VRes = GetDeviceCaps(lDC, 10)
    > ReleaseDC 0, lDC
    > End Function
    >
    > Public Function ColorDepth() As Integer
    > 'Returns the color depth in bits per pixel
    > Dim lDC As Long
    > lDC = GetDC(0)
    > ColorDepth = GetDeviceCaps(lDC, 12) _
    > * GetDeviceCaps(lDC, 14)
    > ReleaseDC 0, lDC
    > End Function
    >
    > Public Function Colors() As Single
    > 'Returns the number of available colors
    > Dim lDC As Long
    > lDC = GetDC(0)
    > Colors = 2 ^ (GetDeviceCaps(lDC, 12) _
    > * GetDeviceCaps(lDC, 14))
    > ReleaseDC 0, lDC
    > End Function
    >
    > Public Function VRefresh() As Integer
    > 'Returns the vertical refresh rate in Hz
    > Dim lDC As Long
    > lDC = GetDC(0)
    > VRefresh = GetDeviceCaps(lDC, 116)
    > ReleaseDC 0, lDC
    > End Function
    >
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "StevenS" wrote:
    >
    > > Hi Tom. I have hard coded the top properties for my shapes, this is the
    > > problem. I have to get my programme to determine the new users monitor size
    > > and set new top properties for my shapes. I am not sure on how to get the new
    > > users monitor size and how to give new top values to the shapes.
    > > --
    > > SS
    > >
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > Shapes have a Height and Width property.
    > > >
    > > > for each shp in ActiceSheet.Shapes
    > > > with shp
    > > > .Height = 1.25 * .Height
    > > > .Width = 1.37 * .Width
    > > > End With
    > > > Next
    > > >
    > > > these are also scalewidth and scaleheight properties
    > > >
    > > > Also look at the LockAspectRatio property.
    > > >
    > > > See help for details.
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > >
    > > > "StevenS" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > I have a similar problem to Dennis. I am trying to get VB to set a scal
    > > > for
    > > > > cells & shapes to suit the current users screen size. I run VB code to
    > > > change
    > > > > the sizing of the shapes for the size shed the customer wants. I'm not
    > > > sure
    > > > > of the code I need to do this.
    > > > >
    > > > > Please help
    > > > > --
    > > > > SS
    > > >
    > > >
    > > >


  6. #6
    Jim Thomlinson
    Guest

    Re: Screen updating

    This code can just be placed into a regular code module. You can get the
    screen resolution by adding the function VRes and HRes.
    --
    HTH...

    Jim Thomlinson


    "StevenS" wrote:

    > Excellent. Excuse my ignorace. Where should this information be placed. When
    > my user opens the programme I want it to fit everything to the screen.
    > --
    > SS
    >
    >
    > "Jim Thomlinson" wrote:
    >
    > > Everything you wanted to know about monitors but were affraid to ask...
    > >
    > > Declare Function GetDeviceCaps Lib "Gdi32" _
    > > (ByVal hdc As Long, ByVal nIndex As Long) As Long
    > > Declare Function GetDC Lib "User32" _
    > > (ByVal hWnd As Long) As Long
    > > Declare Function ReleaseDC Lib "User32" _
    > > (ByVal hWnd As Long, ByVal hdc As Long) As Long
    > >
    > > Public Function HRes() As Integer
    > > 'Returns the horizontal resolution in pixels
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > HRes = GetDeviceCaps(lDC, 8)
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > Public Function VRes() As Integer
    > > 'Returns the vertical resolution in pixels
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > VRes = GetDeviceCaps(lDC, 10)
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > Public Function ColorDepth() As Integer
    > > 'Returns the color depth in bits per pixel
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > ColorDepth = GetDeviceCaps(lDC, 12) _
    > > * GetDeviceCaps(lDC, 14)
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > Public Function Colors() As Single
    > > 'Returns the number of available colors
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > Colors = 2 ^ (GetDeviceCaps(lDC, 12) _
    > > * GetDeviceCaps(lDC, 14))
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > Public Function VRefresh() As Integer
    > > 'Returns the vertical refresh rate in Hz
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > VRefresh = GetDeviceCaps(lDC, 116)
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "StevenS" wrote:
    > >
    > > > Hi Tom. I have hard coded the top properties for my shapes, this is the
    > > > problem. I have to get my programme to determine the new users monitor size
    > > > and set new top properties for my shapes. I am not sure on how to get the new
    > > > users monitor size and how to give new top values to the shapes.
    > > > --
    > > > SS
    > > >
    > > >
    > > > "Tom Ogilvy" wrote:
    > > >
    > > > > Shapes have a Height and Width property.
    > > > >
    > > > > for each shp in ActiceSheet.Shapes
    > > > > with shp
    > > > > .Height = 1.25 * .Height
    > > > > .Width = 1.37 * .Width
    > > > > End With
    > > > > Next
    > > > >
    > > > > these are also scalewidth and scaleheight properties
    > > > >
    > > > > Also look at the LockAspectRatio property.
    > > > >
    > > > > See help for details.
    > > > >
    > > > > --
    > > > > Regards,
    > > > > Tom Ogilvy
    > > > >
    > > > >
    > > > > "StevenS" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > I have a similar problem to Dennis. I am trying to get VB to set a scal
    > > > > for
    > > > > > cells & shapes to suit the current users screen size. I run VB code to
    > > > > change
    > > > > > the sizing of the shapes for the size shed the customer wants. I'm not
    > > > > sure
    > > > > > of the code I need to do this.
    > > > > >
    > > > > > Please help
    > > > > > --
    > > > > > SS
    > > > >
    > > > >
    > > > >


  7. #7
    Tom Ogilvy
    Guest

    Re: Screen updating

    Unless you are going to predetermine the locations of your shapes for each
    resolution setting, I think you can skip all the API stuff and just work
    with

    set rng = ActiveWindow.VisibleRange

    If Excel is not full screen, then knowing the resolution doesn't buy you
    much.

    Assume you want one shape to start at the top if the visible range and
    centered horizontally

    Sub EFG()
    Set shp = ActiveSheet.Shapes(1)
    With shp
    .Top = ActiveWindow.VisibleRange.Top
    .Left = ActiveWindow.VisibleRange.Width / 2 - .Width / 2
    End With

    End Sub

    This is just an example - you would have to adapt it to accomplish what you
    want to do.

    --
    Regards,



    "StevenS" <[email protected]> wrote in message
    news:[email protected]...
    > Excellent. Excuse my ignorace. Where should this information be placed.

    When
    > my user opens the programme I want it to fit everything to the screen.
    > --
    > SS
    >
    >
    > "Jim Thomlinson" wrote:
    >
    > > Everything you wanted to know about monitors but were affraid to ask...
    > >
    > > Declare Function GetDeviceCaps Lib "Gdi32" _
    > > (ByVal hdc As Long, ByVal nIndex As Long) As Long
    > > Declare Function GetDC Lib "User32" _
    > > (ByVal hWnd As Long) As Long
    > > Declare Function ReleaseDC Lib "User32" _
    > > (ByVal hWnd As Long, ByVal hdc As Long) As Long
    > >
    > > Public Function HRes() As Integer
    > > 'Returns the horizontal resolution in pixels
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > HRes = GetDeviceCaps(lDC, 8)
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > Public Function VRes() As Integer
    > > 'Returns the vertical resolution in pixels
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > VRes = GetDeviceCaps(lDC, 10)
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > Public Function ColorDepth() As Integer
    > > 'Returns the color depth in bits per pixel
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > ColorDepth = GetDeviceCaps(lDC, 12) _
    > > * GetDeviceCaps(lDC, 14)
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > Public Function Colors() As Single
    > > 'Returns the number of available colors
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > Colors = 2 ^ (GetDeviceCaps(lDC, 12) _
    > > * GetDeviceCaps(lDC, 14))
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > Public Function VRefresh() As Integer
    > > 'Returns the vertical refresh rate in Hz
    > > Dim lDC As Long
    > > lDC = GetDC(0)
    > > VRefresh = GetDeviceCaps(lDC, 116)
    > > ReleaseDC 0, lDC
    > > End Function
    > >
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "StevenS" wrote:
    > >
    > > > Hi Tom. I have hard coded the top properties for my shapes, this is

    the
    > > > problem. I have to get my programme to determine the new users monitor

    size
    > > > and set new top properties for my shapes. I am not sure on how to get

    the new
    > > > users monitor size and how to give new top values to the shapes.
    > > > --
    > > > SS
    > > >
    > > >
    > > > "Tom Ogilvy" wrote:
    > > >
    > > > > Shapes have a Height and Width property.
    > > > >
    > > > > for each shp in ActiceSheet.Shapes
    > > > > with shp
    > > > > .Height = 1.25 * .Height
    > > > > .Width = 1.37 * .Width
    > > > > End With
    > > > > Next
    > > > >
    > > > > these are also scalewidth and scaleheight properties
    > > > >
    > > > > Also look at the LockAspectRatio property.
    > > > >
    > > > > See help for details.
    > > > >
    > > > > --
    > > > > Regards,
    > > > > Tom Ogilvy
    > > > >
    > > > >
    > > > > "StevenS" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > I have a similar problem to Dennis. I am trying to get VB to set a

    scal
    > > > > for
    > > > > > cells & shapes to suit the current users screen size. I run VB

    code to
    > > > > change
    > > > > > the sizing of the shapes for the size shed the customer wants. I'm

    not
    > > > > sure
    > > > > > of the code I need to do this.
    > > > > >
    > > > > > Please help
    > > > > > --
    > > > > > SS
    > > > >
    > > > >
    > > > >




  8. #8
    StevenS
    Guest

    Re: Screen updating

    Thanks Tom.

    Is the ActiveWindow.VisibleRange.Width the actual width of the excel
    workbook. I have tried resizing some items to this but it does not seem
    correct.
    --
    SS


    "Tom Ogilvy" wrote:

    > Unless you are going to predetermine the locations of your shapes for each
    > resolution setting, I think you can skip all the API stuff and just work
    > with
    >
    > set rng = ActiveWindow.VisibleRange
    >
    > If Excel is not full screen, then knowing the resolution doesn't buy you
    > much.
    >
    > Assume you want one shape to start at the top if the visible range and
    > centered horizontally
    >
    > Sub EFG()
    > Set shp = ActiveSheet.Shapes(1)
    > With shp
    > .Top = ActiveWindow.VisibleRange.Top
    > .Left = ActiveWindow.VisibleRange.Width / 2 - .Width / 2
    > End With
    >
    > End Sub
    >
    > This is just an example - you would have to adapt it to accomplish what you
    > want to do.
    >
    > --
    > Regards,
    >
    >
    >
    > "StevenS" <[email protected]> wrote in message
    > news:[email protected]...
    > > Excellent. Excuse my ignorace. Where should this information be placed.

    > When
    > > my user opens the programme I want it to fit everything to the screen.
    > > --
    > > SS
    > >
    > >
    > > "Jim Thomlinson" wrote:
    > >
    > > > Everything you wanted to know about monitors but were affraid to ask...
    > > >
    > > > Declare Function GetDeviceCaps Lib "Gdi32" _
    > > > (ByVal hdc As Long, ByVal nIndex As Long) As Long
    > > > Declare Function GetDC Lib "User32" _
    > > > (ByVal hWnd As Long) As Long
    > > > Declare Function ReleaseDC Lib "User32" _
    > > > (ByVal hWnd As Long, ByVal hdc As Long) As Long
    > > >
    > > > Public Function HRes() As Integer
    > > > 'Returns the horizontal resolution in pixels
    > > > Dim lDC As Long
    > > > lDC = GetDC(0)
    > > > HRes = GetDeviceCaps(lDC, 8)
    > > > ReleaseDC 0, lDC
    > > > End Function
    > > >
    > > > Public Function VRes() As Integer
    > > > 'Returns the vertical resolution in pixels
    > > > Dim lDC As Long
    > > > lDC = GetDC(0)
    > > > VRes = GetDeviceCaps(lDC, 10)
    > > > ReleaseDC 0, lDC
    > > > End Function
    > > >
    > > > Public Function ColorDepth() As Integer
    > > > 'Returns the color depth in bits per pixel
    > > > Dim lDC As Long
    > > > lDC = GetDC(0)
    > > > ColorDepth = GetDeviceCaps(lDC, 12) _
    > > > * GetDeviceCaps(lDC, 14)
    > > > ReleaseDC 0, lDC
    > > > End Function
    > > >
    > > > Public Function Colors() As Single
    > > > 'Returns the number of available colors
    > > > Dim lDC As Long
    > > > lDC = GetDC(0)
    > > > Colors = 2 ^ (GetDeviceCaps(lDC, 12) _
    > > > * GetDeviceCaps(lDC, 14))
    > > > ReleaseDC 0, lDC
    > > > End Function
    > > >
    > > > Public Function VRefresh() As Integer
    > > > 'Returns the vertical refresh rate in Hz
    > > > Dim lDC As Long
    > > > lDC = GetDC(0)
    > > > VRefresh = GetDeviceCaps(lDC, 116)
    > > > ReleaseDC 0, lDC
    > > > End Function
    > > >
    > > > --
    > > > HTH...
    > > >
    > > > Jim Thomlinson
    > > >
    > > >
    > > > "StevenS" wrote:
    > > >
    > > > > Hi Tom. I have hard coded the top properties for my shapes, this is

    > the
    > > > > problem. I have to get my programme to determine the new users monitor

    > size
    > > > > and set new top properties for my shapes. I am not sure on how to get

    > the new
    > > > > users monitor size and how to give new top values to the shapes.
    > > > > --
    > > > > SS
    > > > >
    > > > >
    > > > > "Tom Ogilvy" wrote:
    > > > >
    > > > > > Shapes have a Height and Width property.
    > > > > >
    > > > > > for each shp in ActiceSheet.Shapes
    > > > > > with shp
    > > > > > .Height = 1.25 * .Height
    > > > > > .Width = 1.37 * .Width
    > > > > > End With
    > > > > > Next
    > > > > >
    > > > > > these are also scalewidth and scaleheight properties
    > > > > >
    > > > > > Also look at the LockAspectRatio property.
    > > > > >
    > > > > > See help for details.
    > > > > >
    > > > > > --
    > > > > > Regards,
    > > > > > Tom Ogilvy
    > > > > >
    > > > > >
    > > > > > "StevenS" <[email protected]> wrote in message
    > > > > > news:[email protected]...
    > > > > > > I have a similar problem to Dennis. I am trying to get VB to set a

    > scal
    > > > > > for
    > > > > > > cells & shapes to suit the current users screen size. I run VB

    > code to
    > > > > > change
    > > > > > > the sizing of the shapes for the size shed the customer wants. I'm

    > not
    > > > > > sure
    > > > > > > of the code I need to do this.
    > > > > > >
    > > > > > > Please help
    > > > > > > --
    > > > > > > SS
    > > > > >
    > > > > >
    > > > > >

    >
    >
    >


  9. #9
    Tom Ogilvy
    Guest

    Re: Screen updating

    It is the width of the visible window for the activesheet.

    ? activeCell.ColumnWidth
    8.43
    ? activeCell.Width
    48
    ? ActiveWindow.VisibleRange.Columns.Count
    13
    ? 13 * 48
    624
    ? ActiveWindow.VisibleRange.Width
    624


    So all the columns were the same width (the default for my computer) of 48
    There were 13 columns visible - then 13 * 48 = 624

    Same results is achieved with ActiveWindow.VisibleRange.Width

    --
    Regards,
    Tom Ogilvy



    "StevenS" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Tom.
    >
    > Is the ActiveWindow.VisibleRange.Width the actual width of the excel
    > workbook. I have tried resizing some items to this but it does not seem
    > correct.
    > --
    > SS
    >
    >
    > "Tom Ogilvy" wrote:
    >
    > > Unless you are going to predetermine the locations of your shapes for

    each
    > > resolution setting, I think you can skip all the API stuff and just work
    > > with
    > >
    > > set rng = ActiveWindow.VisibleRange
    > >
    > > If Excel is not full screen, then knowing the resolution doesn't buy you
    > > much.
    > >
    > > Assume you want one shape to start at the top if the visible range and
    > > centered horizontally
    > >
    > > Sub EFG()
    > > Set shp = ActiveSheet.Shapes(1)
    > > With shp
    > > .Top = ActiveWindow.VisibleRange.Top
    > > .Left = ActiveWindow.VisibleRange.Width / 2 - .Width / 2
    > > End With
    > >
    > > End Sub
    > >
    > > This is just an example - you would have to adapt it to accomplish what

    you
    > > want to do.
    > >
    > > --
    > > Regards,
    > >
    > >
    > >
    > > "StevenS" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Excellent. Excuse my ignorace. Where should this information be

    placed.
    > > When
    > > > my user opens the programme I want it to fit everything to the screen.
    > > > --
    > > > SS
    > > >
    > > >
    > > > "Jim Thomlinson" wrote:
    > > >
    > > > > Everything you wanted to know about monitors but were affraid to

    ask...
    > > > >
    > > > > Declare Function GetDeviceCaps Lib "Gdi32" _
    > > > > (ByVal hdc As Long, ByVal nIndex As Long) As Long
    > > > > Declare Function GetDC Lib "User32" _
    > > > > (ByVal hWnd As Long) As Long
    > > > > Declare Function ReleaseDC Lib "User32" _
    > > > > (ByVal hWnd As Long, ByVal hdc As Long) As Long
    > > > >
    > > > > Public Function HRes() As Integer
    > > > > 'Returns the horizontal resolution in pixels
    > > > > Dim lDC As Long
    > > > > lDC = GetDC(0)
    > > > > HRes = GetDeviceCaps(lDC, 8)
    > > > > ReleaseDC 0, lDC
    > > > > End Function
    > > > >
    > > > > Public Function VRes() As Integer
    > > > > 'Returns the vertical resolution in pixels
    > > > > Dim lDC As Long
    > > > > lDC = GetDC(0)
    > > > > VRes = GetDeviceCaps(lDC, 10)
    > > > > ReleaseDC 0, lDC
    > > > > End Function
    > > > >
    > > > > Public Function ColorDepth() As Integer
    > > > > 'Returns the color depth in bits per pixel
    > > > > Dim lDC As Long
    > > > > lDC = GetDC(0)
    > > > > ColorDepth = GetDeviceCaps(lDC, 12) _
    > > > > * GetDeviceCaps(lDC, 14)
    > > > > ReleaseDC 0, lDC
    > > > > End Function
    > > > >
    > > > > Public Function Colors() As Single
    > > > > 'Returns the number of available colors
    > > > > Dim lDC As Long
    > > > > lDC = GetDC(0)
    > > > > Colors = 2 ^ (GetDeviceCaps(lDC, 12) _
    > > > > * GetDeviceCaps(lDC, 14))
    > > > > ReleaseDC 0, lDC
    > > > > End Function
    > > > >
    > > > > Public Function VRefresh() As Integer
    > > > > 'Returns the vertical refresh rate in Hz
    > > > > Dim lDC As Long
    > > > > lDC = GetDC(0)
    > > > > VRefresh = GetDeviceCaps(lDC, 116)
    > > > > ReleaseDC 0, lDC
    > > > > End Function
    > > > >
    > > > > --
    > > > > HTH...
    > > > >
    > > > > Jim Thomlinson
    > > > >
    > > > >
    > > > > "StevenS" wrote:
    > > > >
    > > > > > Hi Tom. I have hard coded the top properties for my shapes, this

    is
    > > the
    > > > > > problem. I have to get my programme to determine the new users

    monitor
    > > size
    > > > > > and set new top properties for my shapes. I am not sure on how to

    get
    > > the new
    > > > > > users monitor size and how to give new top values to the shapes.
    > > > > > --
    > > > > > SS
    > > > > >
    > > > > >
    > > > > > "Tom Ogilvy" wrote:
    > > > > >
    > > > > > > Shapes have a Height and Width property.
    > > > > > >
    > > > > > > for each shp in ActiceSheet.Shapes
    > > > > > > with shp
    > > > > > > .Height = 1.25 * .Height
    > > > > > > .Width = 1.37 * .Width
    > > > > > > End With
    > > > > > > Next
    > > > > > >
    > > > > > > these are also scalewidth and scaleheight properties
    > > > > > >
    > > > > > > Also look at the LockAspectRatio property.
    > > > > > >
    > > > > > > See help for details.
    > > > > > >
    > > > > > > --
    > > > > > > Regards,
    > > > > > > Tom Ogilvy
    > > > > > >
    > > > > > >
    > > > > > > "StevenS" <[email protected]> wrote in message
    > > > > > > news:[email protected]...
    > > > > > > > I have a similar problem to Dennis. I am trying to get VB to

    set a
    > > scal
    > > > > > > for
    > > > > > > > cells & shapes to suit the current users screen size. I run VB

    > > code to
    > > > > > > change
    > > > > > > > the sizing of the shapes for the size shed the customer wants.

    I'm
    > > not
    > > > > > > sure
    > > > > > > > of the code I need to do this.
    > > > > > > >
    > > > > > > > Please help
    > > > > > > > --
    > > > > > > > SS
    > > > > > >
    > > > > > >
    > > > > > >

    > >
    > >
    > >




+ 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