Problem with Monitor 4K

TeeChart for ActiveX, COM and ASP
Post Reply
PhG47
Newbie
Newbie
Posts: 5
Joined: Fri Mar 24, 2017 12:00 am
Location: Villars-sur-Glane, Switzerland
Contact:

Problem with Monitor 4K

Post by PhG47 » Thu Apr 06, 2017 6:33 am

Hi,

It is impossible to resize a control "TeeChart on 2017 Pro ActiveX" by code if the size in [Twips] of the screen is bigger than a single integer. Integer long is required.

TChart.Width
TChart.Height

You can correct this problem

Philippe

PhG47
Newbie
Newbie
Posts: 5
Joined: Fri Mar 24, 2017 12:00 am
Location: Villars-sur-Glane, Switzerland
Contact:

Re: Problem with Monitor 4K

Post by PhG47 » Fri Apr 07, 2017 5:45 am

Hi,

Detailed testing...

TChart.Width
TChart.Height

The maximal value accepted is 31450, is too small for a monitor 4K...

Best regards

Philippe

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with Monitor 4K

Post by Yeray » Mon Apr 10, 2017 10:24 am

Hello,

TChart ActiveX is a wrapper from TeeChart VCL; TChart inherits TControl, that declares Width as an Integer. So I'm not sure there's much we can do here.
http://docwiki.embarcadero.com/Librarie ... trol.Width
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

PhG47
Newbie
Newbie
Posts: 5
Joined: Fri Mar 24, 2017 12:00 am
Location: Villars-sur-Glane, Switzerland
Contact:

Re: Problem with Monitor 4K

Post by PhG47 » Mon Apr 10, 2017 11:38 am

Hi,

Thank you for this information. I had an identical problem with the function native of sizing and moving of a form Access. The function "DoCmd.MoveWindow" is limited to values "Integer". But it is the bug of Access that I was able to by-pass with the API... Here is the same constructed function directly with the API. TControl is certainly not updated for a very long time...

Code: Select all

Sub FormMoveWindow(vobForm As Form, Optional vloLeft As Long = -1, Optional vloTop As Long = -1, Optional vloWidth As Long = -1, Optional vloHeight As Long = -1)

' Remplace Access DoCmd.MoveWindow
' en Pixels

    Dim rectForm As RECT
    Dim vloL As Long
    Dim vloT As Long
    Dim vloW As Long
    Dim vloH As Long
    
    If Not ((vloLeft = -1) And (vloTop = -1) And (vloWidth = -1) And (vloHeight = -1)) Then
        
        ' Récupérer le rectangle de la fenêtre du controle
        GetWindowRect vobForm.hwnd, rectForm

        ' Adapter les valeurs
        If vloLeft = -1 Then
            vloL = rectForm.Left
        Else
            vloL = vloLeft
        End If
        If vloTop = -1 Then
            vloT = rectForm.Top
        Else
            vloT = vloTop
        End If
        If vloWidth = -1 Then
            vloW = rectForm.Right - rectForm.Left
        Else
            vloW = vloWidth
        End If
        If vloHeight = -1 Then
            vloH = rectForm.Bottom - rectForm.Top
        Else
            vloH = vloHeight
        End If
        
        ' Repositionner et redimentionner le formulaire
        MoveWindow vobForm.hwnd, vloL, vloT, vloW, vloH, True
    End If

End Sub

If you corrected the bug "Access Anchor Control", I do not maybe need any more to use these properties. But for a monitor 4K, it is not correct.

Thank you very match

Best regards

Philippe

Post Reply