none
Windows forms not completely displayed into monitor

    Question

  • Hi Team,

    I have created a windows application. Runs perfectly. I have tried same application in another pc with same monitor, os, ram etc.,

    But running windows application in another pc the application showed half or 3/4th only. Some Controls are hiding(Not completely viewed).

    I) My doubt is the graphics device driver problem?

    II) I have tried to install device driver but shows error ("installation package not supported by the processor")

    III) Everytime tried to install device driver shows different error.

    IV) How to check and update device(Display) driver?

    Thanks in advance for the help.

    Friday, February 09, 2018 5:06 AM

All replies

  • Hi Team,

    I have created a windows application. Runs perfectly. I have tried same application in another pc with same monitor, os, ram etc.,

    But running windows application in another pc the application showed half or 3/4th only. Some Controls are hiding(Not completely viewed).

    I) My doubt is the graphics device driver problem?

    II) I have tried to install device driver but shows error ("installation package not supported by the processor")

    III) Everytime tried to install device driver shows different error.

    IV) How to check and update device(Display) driver?

    ""Team,I found the screen resolution is different between PC's.
    My pc has resolution 1600 * 900.
    Desination Pc has only 1366 * 768.
    Is there any solutions or suggestions for this issue?

    My PC in windows 10 64 bit version.
    Destination is also the same.""

    Thanks in advance for the help.


    Friday, February 09, 2018 5:33 AM
  • Hello,

    You might consider the following for scaling. Of course you could design your app to work on a specific display size, incorporate TableLayoutPanels, work with anchors for the controls and Form.AutoSize.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, February 09, 2018 11:00 AM
    Moderator
  • Hi,

    I'm not sure I can understand correctly your issue/situation.

    Please make your application DPI-aware.
    (1) [Windows Forms]  AutoScaleMode = DPI
    (2) use "app.manifest" file
        -- [Project] menu > [Add New Item] > select [Application Manifest File]
        -- modify app.manifest like this
    <!-- remove comment: uncommented this section -->
    <application xmlns="urn:schemas-microsoft-com:asm.v3">
        <windowsSettings>
            <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
        </windowsSettings>
    </application>

    # As you know, size of application window (form) is varied by Display setting (Scale and layout) even if resolution of monitor is the same.
        
    Regards,

    Ashidacchi

    • Edited by Ashidacchi Sunday, February 11, 2018 12:26 AM
    Sunday, February 11, 2018 12:25 AM
  • Hi

    You can take intrinsic control of how and where every element on your form reacts to the different size/shape/resolution variations that are thrown at it. What happens when the user maximizes/unmaximises the form? What happens when the user changes the windows display settings 100%/125%/150% . . ? What happens to each control when the user changes the size/shape of the form?

    It is a good idea to offer a font size change option to the user, as the differences between different resolutions on different screens can be great.

    It is a good idea to save the user's options to My.Settings - - - so the changes made can be loaded up next start up of the application.

    I have not time at present to go through my templates and find an example to post - - but will in the next day or so.

    Regards 


    Burn all valuable data to CD/DVD disks. EMP proof.

    Monday, February 12, 2018 8:23 PM
  • Here is an example of a form that maintains the same ratio between it's width and height. The controls are rescaled every time the user changes the shape of the form. After copying this code to a project, you also need to add a string in my.settings. See picture.

    Public Class Form5 ' Example regarding resizing forms and control bounds
        Dim isMax, isEvntSus As Boolean
        Dim fW, fH As Integer
        Dim strFntName As String
        Dim fnt As Font
        Dim reScale As Double
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim I, J, K As Integer
            I = My.Settings.FrmSz.IndexOf(",")
            fW = CInt(My.Settings.FrmSz.Substring(0, I))
            fH = CInt(My.Settings.FrmSz.Substring(I + 1, My.Settings.FrmSz.Length - I - 1))
            isEvntSus = True
            ClientSize = New Size(fW, fH)
            isEvntSus = False
            I = Screen.PrimaryScreen.WorkingArea.Width - Width + fW
            J = Screen.PrimaryScreen.WorkingArea.Height - Height + fH
            If (fW / fH) > (I / J) Then ' screen width will detirmine
                K = CInt(I * 0.75) + Height - fH
                MaximizedBounds = New Rectangle(0, CInt((Screen.PrimaryScreen.WorkingArea.Height - K) / 2), _
                                                Screen.PrimaryScreen.WorkingArea.Width, K)
            Else ' screen height will detirmine
                K = CInt(J / 0.75) + Width - fW
                MaximizedBounds = New Rectangle(CInt((Screen.PrimaryScreen.WorkingArea.Width - K) / 2), _
                                                0, K, Screen.PrimaryScreen.WorkingArea.Height)
            End If
            MinimumSize = New Size(400 + Width - fW, 300 + Height - fH)
            MaximumSize = MaximizedBounds.Size
            strFntName = "microsoft sans serif"
            For Each FF As FontFamily In FontFamily.Families
                If FF.Name.ToLower = "segoe ui" Then strFntName = "segoe ui"
            Next
            Label1.Text = "Label1 Text"
            Button1.Text = "Button1 Text"
            TextBox1.Multiline = True : TextBox1.ScrollBars = ScrollBars.Vertical
            TextBox1.Text = "With the people of that age the value of all things was determined by outward show." & _
                " As religion had declined in power, it had increased in pomp. The educators" & _
                " of the time sought to command respect by display and ostentation. To all this" & _
                " the life of Jesus presented a marked contrast. - Ed pg 77 - Ellen G White"
            refreshBounds()
    
            CenterToScreen()
        End Sub
    
        Private Sub Form5_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
            e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
            e.Graphics.DrawString("Some GDI drawn text . . .", fnt, Brushes.DarkBlue, CInt(reScale * 30), CInt(reScale * 20))
        End Sub
    
        Private Sub Form5_ResizeEnd(sender As Object, e As System.EventArgs) Handles Me.ResizeEnd
            If isEvntSus Then Exit Sub
            Dim K, L As Integer
            K = ClientSize.Width : L = ClientSize.Height
            If K = fW And L = fH Then
                Exit Sub
            ElseIf K = fW And Not L = fH Then
                ClientSize = New Size(CInt(L / 0.75), L)
            ElseIf Not K = fW And L = fH Then
                ClientSize = New Size(K, CInt(K * 0.75))
            ElseIf Not K = fW And Not L = fH Then
                If K / L < 1.333333 Then
                    ClientSize = New Size(K, CInt(K * 0.75))
                Else
                    ClientSize = New Size(CInt(L / 0.75), L)
                End If
            End If
            My.Settings.FrmSz = ClientSize.Width.ToString & "," & ClientSize.Height.ToString
            refreshBounds()
            Invalidate()
        End Sub
    
        Private Sub Form5_SizeChanged(sender As Object, e As System.EventArgs) Handles Me.SizeChanged
            If WindowState = FormWindowState.Minimized Then Exit Sub
            If isMax Then
                isMax = False
                refreshBounds()
                Invalidate()
            End If
            If WindowState = FormWindowState.Maximized Then
                isMax = True
                refreshBounds()
                Invalidate()
            End If
        End Sub
    
        Sub refreshBounds()
            fW = ClientSize.Width : fH = ClientSize.Height
            reScale = fW / 400
            fnt = New Font(strFntName, CInt(reScale * 18), FontStyle.Regular, GraphicsUnit.Pixel)
            Label1.Location = New Point(CInt(reScale * 30), CInt(reScale * 60))
            Button1.SetBounds(CInt(reScale * 200), CInt(reScale * 60), CInt(reScale * 170), CInt(reScale * 40))
            TextBox1.SetBounds(CInt(reScale * 30), CInt(reScale * 120), CInt(reScale * 340), CInt(reScale * 150))
            Label1.Font = fnt : Button1.Font = fnt : TextBox1.Font = fnt
            Text = "Clientsize = { " & fW.ToString & " : " & fH.ToString & " }"
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
            MsgBox("Ouiy")
        End Sub
    End Class


    Burn all valuable data to CD/DVD disks. EMP proof.

    Tuesday, February 13, 2018 8:32 PM